[Resolvconf-devel] Bug#522814: resolvconf: Duplicate domain names in search list due to root domain suffix

Tom Carroll tcarroll+debianreportbug at chimesnet.com
Mon Apr 6 17:39:19 UTC 2009


Package: resolvconf
Version: 1.43
Severity: normal
Tags: patch

The domains from the domain-search dhcp option have the root domain "." 
appended to them.  If the domain-name is provided in domain-search, the 
domain-name will esentially appear twice in the resolv.conf's search 
list, one without the root domain and one with the root domain.

An an example of the problem, dhclient3 invokes /sbin/resolvconf with

domain foo.example.com
search foo.example.com. example.com.
nameserver 192.168.1.1

resolvconf produces a /etc/resolv.conf with

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by 
resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 192.168.1.1
search foo.example.com foo.example.com. example.com.

Note that foo.example.com is given twice in the search list.

The issue lies with how uniquify determines duplicates in
/etc/resolvconf/update.d/libc.  I have included a patch to remedy the 
issue.

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-1-686 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages resolvconf depends on:
ii  coreutils                     6.10-6     The GNU core utilities
ii  debconf [debconf-2.0]         1.5.26     Debian configuration management sy
ii  lsb-base                      3.2-22     Linux Standard Base 3.2 init scrip

resolvconf recommends no packages.

resolvconf suggests no packages.

-- debconf-show failed
-------------- next part --------------
--- libc	2009-04-06 13:35:41.000000000 -0400
+++ libc.new	2009-04-06 13:37:33.000000000 -0400
@@ -59,10 +59,12 @@
 {
 	RSLT=""
 	while [ "$1" ] ; do
+		# Remove the root domain suffix
+		D=$(echo "$1" | sed 's/[.]$//')
 		for E in $RSLT ; do
-			[ "$1" = "$E" ] && { shift ; continue 2 ; }
+			[ "$D" = "$E" ] && { shift ; continue 2 ; }
 		done
-		RSLT="${RSLT:+$RSLT }$1"
+		RSLT="${RSLT:+$RSLT }$D"
 		shift
 	done
 }


More information about the Resolvconf-devel mailing list