Package: dhcp3-client
Version: 3.1.1-6+lenny3
Severity: normal
Tags: patch

The handling of the domain search list is broken in the default
dhclient-script.  When you receive a search list containing multiple
domains like "foo.example.com", "bar.example.com", the variable
$new_domain_search contains a space separated list like
"bar.example.com foo.example.com".

Let's assume our domain name (variable $new_domain_name) is
"foo.example.com".  In dhclient-script, the function
make_resolv_conf() compares our domain name agains this list.
Because $new_domain_search is quoted in the comparison loop,
it tries to check "foo.example.com" against
"bar.example.com foo.example.com" and fail instead of doing two
comparisons, one against "bar.example.com" (would fail) and
another against "foo.example.com" (would succeed).

dhclient-script will then prepend the domain name to the search list,
generating "foo.example.com bar.example.com foo.example.com" as final
result.  This reverses the desired search order received from the DHCP
server.


The following patch just removes the quoted and gets the comparison loop
working.


--- /sbin/dhclient-script       2009-08-19 07:15:06.000000000 +0200
+++ /tmp/dhclient-script        2010-01-27 16:37:23.000000000 +0100
@@ -23,7 +23,7 @@
            #new_domain_search="${new_domain_search% }"
            if [ "$new_domain_name" ]; then
                domain_in_search_list=""
-               for domain in "$new_domain_search"; do
+               for domain in $new_domain_search; do
                        if [ "$domain" = "$new_domain_name" ]; then
                                domain_in_search="Yes"
                        fi


P.S.: The usage of tabs vs. spaces for indentation is inconsistent.

-- System Information:
Debian Release: 5.0.3
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-2-686 (SMP w/1 CPU core)
Locale: LANG=en_GB.ISO8859-1, lc_ctype=de...@euro (charmap=ISO-8859-15)
Shell: /bin/sh linked to /bin/bash

Versions of packages dhcp3-client depends on:
ii  debconf [debconf-2.0]     1.5.24         Debian configuration management sy
ii  debianutils               2.30           Miscellaneous utilities specific t
ii  dhcp3-common              3.1.1-6+lenny3 common files used by all the dhcp3
ii  libc6                     2.7-18lenny2   GNU C Library: Shared libraries

dhcp3-client recommends no packages.

Versions of packages dhcp3-client suggests:
pn  avahi-autoipd                 <none>     (no description available)
pn  resolvconf                    <none>     (no description available)

-- debconf information:
  dhcp3-client/dhclient-needs-restarting:
  dhcp3-client/dhclient-script_moved:



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to