[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#815166: marked as done (preseed/url: correctly handle IPv6 addresses)



Your message dated Tue, 23 Feb 2016 23:05:53 +0000
with message-id <E1aYM1h-00045e-Ji@franck.debian.org>
and subject line Bug#815166: fixed in preseed 1.71
has caused the Debian Bug report #815166,
regarding preseed/url: correctly handle IPv6 addresses
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
815166: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=815166
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: preseed
Version: 1.70
Severity: normal
Tags: d-i patch

Dear maintainer,

trying to fetch a preseed URL using an IPv6 address fails.  For example,
consider the preseed/url setting:
	http://[fd00:9:152:48:1822:ffff:162:199]/dir/preseed.cfg
which becomes
        http://[fd00.example.org:9:152:48:1822:ffff:162:199]/dir/preseed.cfg

The problem is that "fd00" is treated as hostname without domain and, thus,
the domain name is appended resulting in "fd00.example.org".  Of course,
this is no longer a valid IPv6 address.

To solve this problem, I added a patch that enhances the auto-install.sh
to detect IPv6 addresses.  I also added few more unit test cases to cover
different URLs with IPv6 addresses with user, password, and port variations:

	[...]
	ok 11 - ftp with user/password, IPv4, and domain
	ok 12 - ftp with user/password, IPv4, and domain and port
	ok 13 - http with short IPv6 and domain
	ok 14 - http with simple IPv6 and domain
	ok 15 - http with IPv6 and domain
	ok 16 - http with IPv6, port, and domain
	ok 17 - http with user/password, IPv6 and domain
	ok 18 - http with user/password, IPv6, port, and domain

Thanks and kind regards,
  Hendrik
>From dbc8bc790c781530954d2b58b0050472bbaef354 Mon Sep 17 00:00:00 2001
From: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Date: Fri, 19 Feb 2016 11:23:50 +0100
Subject: [PATCH] auto-install: correctly handle IPv6 addresses

The auto-install does not properly detect IPv6 address when they
are specified in an URL.  Typically, the first IPv6 address part
is to be considered as the hostname and, if specified, a domain
name is appended.  For example,

    http://[fd00:9:152:48:1822:ffff:162:199]/dir/preseed.cfg

becomes

    http://[fd00.example.org:9:152:48:1822:ffff:162:199]/dir/preseed.cfg

which is no longer a valid IPv6 address.  To solve this problem,
enhance auto-install.sh and test for IPv6 addresses in URLs.
Also added few IPv6 unit test cases.

Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
---
 auto-install.sh     |    5 +++-
 t/01-auto-install.t |   55 +++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 59 insertions(+), 1 deletions(-)

diff --git a/auto-install.sh b/auto-install.sh
index a1551a1..e38ecf5 100755
--- a/auto-install.sh
+++ b/auto-install.sh
@@ -34,7 +34,10 @@ else
 	db_get auto-install/defaultroot && dir="$RET"
 fi
 
-if expr $host_port : [^.]*$ >/dev/null; then
+if expr "$host_port" : '^.*\[[:a-fA-F0-9]*\]' > /dev/null; then
+	# IPv6 address with or without port
+	:
+elif expr $host_port : [^.]*$ >/dev/null; then
 	db_get netcfg/get_domain && domain="$RET"
 
 	if [ -n "$domain" ] && [ "$domain" != "unassigned-domain" ] && [ "$domain" != "unnassigned-domain" ]; then
diff --git a/t/01-auto-install.t b/t/01-auto-install.t
index 10e6945..4822536 100755
--- a/t/01-auto-install.t
+++ b/t/01-auto-install.t
@@ -122,6 +122,61 @@ is(run_test('preseed/url'=>'ftp://foo/preseed.cfg',
    'ftp:// is kept'
   );
 
+is(run_test('preseed/url'=>'ftp://user:pass@10.11.12.13/foo/preseed.cfg',
+	    'netcfg/get_domain' => 'example.org',
+	   ),
+    'preseed/url=ftp://user:pass@10.11.12.13/foo/preseed.cfg',
+    'ftp with user/password, IPv4, and domain'
+  );
+
+is(run_test('preseed/url'=>'ftp://user:pass@10.11.12.13:8080/foo/preseed.cfg',
+	    'netcfg/get_domain' => 'example.org',
+	   ),
+    'preseed/url=ftp://user:pass@10.11.12.13:8080/foo/preseed.cfg',
+    'ftp with user/password, IPv4, and domain and port'
+  );
+
+is(run_test('preseed/url'=>'http://[fe80::5054:ff:fe23:8018]/foo/preseed.cfg',
+	    'netcfg/get_domain' => 'example.org',
+	   ),
+    'preseed/url=http://[fe80::5054:ff:fe23:8018]/foo/preseed.cfg',
+    'http with short IPv6 and domain'
+  );
+
+is(run_test('preseed/url'=>'http://[::1]/foo/preseed.cfg',
+	    'netcfg/get_domain' => 'example.org',
+	   ),
+    'preseed/url=http://[::1]/foo/preseed.cfg',
+    'http with simple IPv6 and domain'
+  );
+is(run_test('preseed/url'=>'http://[fd00:9:152:48:1822:ffff:162:199]/foo/preseed.cfg',
+	    'netcfg/get_domain' => 'example.org',
+	   ),
+    'preseed/url=http://[fd00:9:152:48:1822:ffff:162:199]/foo/preseed.cfg',
+    'http with IPv6 and domain'
+  );
+
+is(run_test('preseed/url'=>'http://[fd00:9:152:48:1822:ffff:162:199]:8080/foo/preseed.cfg',
+	    'netcfg/get_domain' => 'example.org',
+	   ),
+    'preseed/url=http://[fd00:9:152:48:1822:ffff:162:199]:8080/foo/preseed.cfg',
+    'http with IPv6, port, and domain'
+  );
+
+is(run_test('preseed/url'=>'http://user:pass@[fd00:9:152:48:1822:ffff:162:199]/foo/preseed.cfg',
+	    'netcfg/get_domain' => 'example.org',
+	   ),
+    'preseed/url=http://user:pass@[fd00:9:152:48:1822:ffff:162:199]/foo/preseed.cfg',
+    'http with user/password, IPv6 and domain'
+  );
+
+is(run_test('preseed/url'=>'http://user:pass@[fd00:9:152:48:1822:ffff:162:199]:8080/foo/preseed.cfg',
+	    'netcfg/get_domain' => 'example.org',
+	   ),
+    'preseed/url=http://user:pass@[fd00:9:152:48:1822:ffff:162:199]:8080/foo/preseed.cfg',
+    'http with user/password, IPv6, port, and domain'
+  );
+
 # XXX: Write some tests for auto-install/defaultroot
 
 # Clean-up:
-- 
1.7.1


--- End Message ---
--- Begin Message ---
Source: preseed
Source-Version: 1.71

We believe that the bug you reported is fixed in the latest version of
preseed, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 815166@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Dimitri John Ledkov <xnox@ubuntu.com> (supplier of updated preseed package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Tue, 23 Feb 2016 22:35:55 +0000
Source: preseed
Binary: preseed-common network-preseed file-preseed initrd-preseed env-preseed
Architecture: source
Version: 1.71
Distribution: unstable
Urgency: medium
Maintainer: Debian Install System Team <debian-boot@lists.debian.org>
Changed-By: Dimitri John Ledkov <xnox@ubuntu.com>
Description:
 env-preseed - debconf preseeding via environment variables (udeb)
 file-preseed - load debconf preseed file (udeb)
 initrd-preseed - load debconf preseed file from /preseed.cfg on the initrd (udeb)
 network-preseed - download debconf preseed file (udeb)
 preseed-common - common files for preseeding (udeb)
Closes: 815166
Launchpad-Bugs-Fixed: 1547629
Changes:
 preseed (1.71) unstable; urgency=medium
 .
   [ Hendrik Brueckner ]
   * auto-install: correctly handle IPv6 addresses Closes: #815166, LP:
     #1547629
Checksums-Sha1:
 d1903c28d0caa1ed31a79c96fa741bba0dfe6213 1521 preseed_1.71.dsc
 ea01f885220fff3e62259e4a1d4ceab1d7a562e2 74932 preseed_1.71.tar.xz
Checksums-Sha256:
 9433b3e7202dde2323e8143a81f08a17679e10723a03d8e4dbbc9768717547ee 1521 preseed_1.71.dsc
 b2368edc86eff21718a87d956512eab19d43e08bb3a9df05f3c47b6a3c9c54f7 74932 preseed_1.71.tar.xz
Files:
 c581613aa3928700c77e3b19bfc1607e 1521 debian-installer optional preseed_1.71.dsc
 a06115596b8d9237d705275ff68aff50 74932 debian-installer optional preseed_1.71.tar.xz

-----BEGIN PGP SIGNATURE-----

iQEcBAEBCgAGBQJWzOBjAAoJEMrC2LnNLKX5N2sIAIyqgrxmBQ2JnRUvPdTKz4pb
C5ox1Zz9kOHtuFnrE4vhaUaOd8as8nA9Zigy2N+DiA7nOoE2MlGM/UsMCttHgJg4
3w8xrHXQp1ebtGM5dJ6njafC2PcVFOeWmOfNYC2zs8UolXueT1RqIcUgAO3G2Ub+
mdagbGk5UiVkEiJFx+jxQX5965DlE83YtlNcU80PG1bzVlInQTyBQDxZCQS+OWXi
eJ7ahGUEnPtu8BHmFaDArcU9eXeAqQG/5Bg7PAC7glR1MR3D0WH0NqPyazHYQgEx
3vNL/aTIQIdf0fH84P5232Y+ugFpMXCD+y5hPm9uGfKnZNQMWVjlD6pByLwBUcM=
=FiDn
-----END PGP SIGNATURE-----

--- End Message ---

Reply to: