Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 222381 - net-misc/dhcpcd-4.0.0_beta2: a NUL can end up in resolv.conf and resolvconf bails out
Summary: net-misc/dhcpcd-4.0.0_beta2: a NUL can end up in resolv.conf and resolvconf b...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High minor (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-16 11:12 UTC by j0w4z3
Modified: 2008-10-07 13:02 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description j0w4z3 2008-05-16 11:12:01 UTC
$new_domain_name in make_resolv_conf() in /etc/dhcpcd/dhcpcd.sh somehow contained a NUL-byte which would be printf'd to resolvconf in line 73.

This caused =net-dns/resolvconf-gentoo-1.4's /sbin/resolvconf in line 46, function echo_resolv() to output "Binary file interfaces/eth0 matches" which would eventually end up in /etc/resolv.conf rendering ns lookups unusable

Reproducible: Always

Steps to Reproduce:
1. dhcpcd eth0 -t 8640000
2. sleep 30
3. cat /etc/resolv.conf

Actual Results:  
# Generated by resolvconf
Binary file /etc/resolvconf/run/interfaces/eth0 matches

Expected Results:  
# Generated by resolvconf
nameserver 10.0.0.1

I can't reproduce if this happenes everywhere, as I am on vacation, but this didn't happen with =net-misc/dhcpcd-3.2.3. It doesn't matter if I connect wired or wireless.

I circumvented the problem by replacing /etc/resolvconf's line 46
  grep "." "${IFACEDIR}/$1"
with
  sed 's/^search \x00$//' "$IFACEDIR/$1" | grep "."
in function echo_resolv() which works for me. Alternatively one could filter out the NUL in make_resolv_conf() in /etc/dhcpcd/dhcpcd.sh in function make_resolv_conf() or at it's source where the setenv new_domain_name happens (which I didn't track down).

Possibly other environment variables are affected, too.
Comment 1 Roy Marples 2008-05-19 09:55:08 UTC
Could you attach a packet capture (tcpdump -s 0 -w /tmp/capture -i eth0) or a wireshark trace of this happening please?

This *may* have been fixed in beta3 which is now out.
Comment 2 Roy Marples 2008-05-19 15:06:21 UTC
Or attach /var/lib/dhcpcd/dhcpcd-eth0.lease from the lease that causes this error.
Comment 3 Peter Alfredsen (RETIRED) gentoo-dev 2008-10-07 13:02:13 UTC
[14:33] <rsmarples> dberkholz (or anyone with a bugzie dev account): be a darling and close bugs #215295, #216005, #217666 and #222381 as dhcpcd-4 is now in stable and closes those issues