Bug 450042 - search line in /etc/resolv.conf contains '\032'
Summary: search line in /etc/resolv.conf contains '\032'
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: dhcp
Version: 9
Hardware: All
OS: Linux
low
high
Target Milestone: ---
Assignee: David Cantrell
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 458555 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-06-04 21:59 UTC by Levente Farkas
Modified: 2008-10-20 21:38 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-10-20 21:22:08 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Levente Farkas 2008-06-04 21:59:06 UTC
Description of problem:
if i set in /etc/dhclient.conf:
supersede domain-search "lfarkas.org. int.bppiac.hu.";
then in /etc/resolv.conf:
search lfarkas.org.\032int.bppiac.hu.
and of course these \032 are not working.


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Levente Farkas 2008-06-09 11:47:59 UTC
same problem here:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=399084

Comment 2 David Cantrell 2008-06-21 19:13:32 UTC
Patch applied to package CVS, will be in the next build in rawhide (NVR will be dhcp-4.0.0-16.fc10).  
Thanks.

Comment 3 Levente Farkas 2008-06-21 19:58:48 UTC
wouldn't it be useful to create a f9 update for this?
anyway this is still not in koji:-(

Comment 4 David Cantrell 2008-06-21 20:00:40 UTC
I haven't built yet because I'm working on some other patches for this build.

I can prepare an update for F-9, sure.

Comment 5 David Cantrell 2008-06-24 13:39:48 UTC
An update for this problem has been pushed in to the F-9 Testing Updates collection.

Comment 6 Levente Farkas 2008-06-24 14:24:07 UTC
may be tomorrow, since i can't see in update/testing not in koji today:-(

Comment 7 Levente Farkas 2008-07-01 18:36:39 UTC
dhclient-4.0.0-16.fc9.i386 do not solve the problem:-(


Comment 8 Levente Farkas 2008-07-10 17:34:58 UTC
any progress?

Comment 9 David Cantrell 2008-07-14 20:05:02 UTC
(In reply to comment #8)
> any progress?

Sorry, was on vacation for the past 10 days.  Back to work now and will get back on this problem asap.

Thanks.

Comment 10 Levente Farkas 2008-07-25 11:40:04 UTC
any progress? it's very annoying on my laptop i always have to cp the old
resolv.conf:-(

Comment 11 David Cantrell 2008-08-01 20:57:21 UTC
Update coming shortly to address this problem.  It will appear in the F-9 testing updates repository.

Comment 12 Fedora Update System 2008-08-01 22:44:35 UTC
dhcp-4.0.0-17.fc9 has been submitted as an update for Fedora 9

Comment 13 Levente Farkas 2008-08-03 19:08:45 UTC
i already try it yesterday (just because the bugzilla update not able to report it) so it's still not working!
is it so hard to fix this simple bug?

Comment 14 David Cantrell 2008-08-04 20:29:09 UTC
I originally looked at the Debian bug you pointed me to, which was http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=399084

But if you read that bug, it does not match your description of the problem.  However, on that page, Debian bug #461056 does describe your problem, so I went to that:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=461056

Message #5 on 461056 describes the problem and that's how I patched our dhclient-script.  Here's the block from make_resolv_conf() in our dhclient-script:

        if [ -z "$SEARCH" ]; then
            if [ -n "$new_domain_search" ]; then
                echo "search ${new_domain_search//\\032/ }" >> $rscf
            else
                if [ -n "$new_domain_name" ]; then
                    echo "search ${new_domain_name//\\032/ }" >> $rscf
                fi
            fi
        else
            echo "search $SEARCH" >> $rscf
        fi

As the Debian bug indicates, the required change is to make sure you have //\\032 rather than /\\032 in the script.

This change first appeared in dhcp-4.0.0-16.fc9 and is currently available in the updates-testing repository for F-9.  Can you check and see which package you have installed for dhclient?

If it's correct, remember the Debian bug also notes the syntax of the supersede domain-search parameter in the dhclient.conf file:

        supersede domain-search "lfarkas.org.", "int.bppiac.hu.";

Comment 15 Levente Farkas 2008-08-05 10:10:19 UTC
as i wrote earlier in #7 dhclient-4.0.0-16.fc9.i386 don't working, now i download dhclient-4.0.0-17.fc9.i386.rpm from:
http://koji.fedoraproject.org/koji/buildinfo?buildID=58325
(since it was not in fedora updates at that time) and it's still not working ie. i've got such resolv.conf:
search lfarkas.org.\032int.bppiac.hu.
actually i can check only at home the supersede format, but according to man dhclient.conf the format is the same as for domain-name and at the end the example said:
supersede domain-name "fugue.com rc.vix.com home.vix.com";
but anyway i'll try it ad the evning.

Comment 16 David Cantrell 2008-08-06 19:39:28 UTC
Investigating the bug further, I found that common/tables.c was not handling the /etc/dhclient.conf file correctly.  I patched that and with a few other changes to /sbin/dhclient-script, I have verified that it works for me here.

The new build will be dhcp-4.0.0-18.fc9

NOTE: Make sure you do not have a SEARCH variable defined in /etc/sysconfig/network-scripts/ifcfg-ethX for your interface.  That will override the /etc/dhclient.conf setting and any option handed back from the DHCP server.

On my system, my /etc/dhclient.conf file had the following line:

      supersede domain-search "one.com. two.com. three.com.";

Before the patch to dhclient-script and common/tables.c, I was getting this line in resolv.conf:

      search one.com.\032two.com.\032three.com.

With the dhcp-4.0.0-18.fc9 build, I get this line:

      search one.com. two.com. three.com.

Thank you for your patience.  An update will be available soon (waiting on the build to finish).

Comment 17 Fedora Update System 2008-08-06 19:58:07 UTC
dhcp-4.0.0-18.fc9 has been submitted as an update for Fedora 9

Comment 18 Levente Farkas 2008-08-06 22:32:18 UTC
i wouldn't like to test the old version just the latest, but still not working:-(

[root@sas ~]# rpm -qa|grep dhc|sort
dhclient-4.0.0-18.fc9.i386
dhcpv6-client-1.0.14-1.fc9.i386
libdhcp-1.99.8-1.fc9.i386
libdhcp4client-4.0.0-18.fc9.i386
libdhcp6client-1.0.14-1.fc9.i386
[root@sas ~]# cat /etc/dhclient-wlan0.conf 
supersede domain-name "lfarkas.org";
supersede domain-name-servers 192.168.0.2,192.168.0.1;
supersede domain-search "lfarkas.org. int.bppiac.hu. bppiac.hu. int.mkk.hu. mkk.hu. lenux.hu.";
[root@sas ~]# cat /etc/resolv.conf
# generated by NetworkManager, do not edit!

domain lfarkas.org

search lfarkas.org.\032int.bppiac.hu.\032bppiac.hu.\032int.mkk.hu.\032mkk.hu.\032lenux.hu.

nameserver 192.168.0.2
nameserver 192.168.0.1

[root@sas ~]# cat /etc/sysconfig/network-scripts/ifcfg-wlan0 
# Please read /usr/share/doc/initscripts-*/sysconfig.txt
# for the documentation of these parameters.
TYPE=Wireless
DEVICE=wlan0
HWADDR=00:14:a5:2c:2e:8b
BOOTPROTO=dhcp
DHCP_HOSTNAME=
DOMAIN=
ONBOOT=no
USERCTL=yes
#IPV6INIT=no
PEERDNS=no
ESSID=
CHANNEL=
MODE=Managed
#RATE=54M
IPADDR=
NETMASK=
#NM_CONTROLLED=no

Comment 19 Levente Farkas 2008-08-06 22:34:42 UTC
and to be sure it's what is running:
root      3135  0.0  0.1   2516  1192 ?        S    00:26   0:00 /sbin/dhclient -d -sf /usr/libexec/nm-dhcp-client.action -pf /var/run/dhclient-wlan0.pid -lf /var/run/dhclient-wlan0.lease -cf /etc/dhclient-wlan0.conf wlan0

Comment 20 David Cantrell 2008-08-06 22:42:48 UTC
Disable NetworkManager and run dhclient by hand and see what /etc/resolv.conf looks like.

Comment 21 Levente Farkas 2008-08-07 20:52:28 UTC
nothing!
if i disable networkmanager just run ifup wlan0 then it's not called the right command line (i don't know who's fault) since the command line is the following in this case:
/sbin/dhclient -1 -q -lf /var/lib/dhclient/dhclient-wlan0.leases -pf /var/run/dhclient-wlan0.pid wlan0
and of course resolv.conf is not generated:-(

Comment 22 David Cantrell 2008-08-07 21:02:15 UTC
Just run:

      dhclient wlan0

Nothing more.  Does it write out /etc/resolv.conf?

Comment 23 Levente Farkas 2008-08-07 21:14:25 UTC
nothing happend, no resolv.conf written and even if i able to run:
/sbin/dhclient -1 -q -cf /etc/dhclient-wlan0.conf -lf /var/lib/dhclient/dhclient-wlan0.leases -pf /var/run/dhclient-wlan0.pid wlan0
the resolv.conf is not generated! if i delete the file no new file generated!

Comment 24 David Cantrell 2008-08-07 21:19:08 UTC
Something else is wrong with your system then.  Because it's working for me on several systems now.

Is there anything in the debugging output of dhclient?  Run:

       dhclient -d -v wlan0

Comment 25 Levente Farkas 2008-08-07 21:30:50 UTC
[root@sas ~]# dhclient -d -v wlan0
Internet Systems Consortium DHCP Client 4.0.0
Copyright 2004-2007 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/

Listening on LPF/wlan0/00:14:a5:2c:2e:8b
Sending on   LPF/wlan0/00:14:a5:2c:2e:8b
Sending on   Socket/fallback
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 4
DHCPOFFER from 192.168.182.1
DHCPREQUEST on wlan0 to 255.255.255.255 port 67
DHCPACK from 192.168.182.1
bound to 192.168.182.9 -- renewal in 244 seconds.

on another terminal:
[root@sas ~]# ps axww|grep dhclient
 6437 pts/0    S+     0:00 dhclient -d -v wlan0
 6735 ?        S<s    0:00 /sbin/dhclient -1 -q -cf /etc/dhclient-wlan0.conf -lf /var/lib/dhclient/dhclient-wlan0.leases -pf /var/run/dhclient-wlan0.pid wlan0
 6784 pts/1    S+     0:00 grep dhclient
[root@sas ~]# ifconfig 
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:904 errors:0 dropped:0 overruns:0 frame:0
          TX packets:904 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:66048 (64.5 KiB)  TX bytes:66048 (64.5 KiB)

wlan0     Link encap:Ethernet  HWaddr 00:14:A5:2C:2E:8B  
          inet addr:192.168.182.9  Bcast:192.168.182.255  Mask:255.255.255.0
          inet6 addr: fe80::214:a5ff:fe2c:2e8b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4 errors:0 dropped:0 overruns:0 frame:0
          TX packets:27 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1360 (1.3 KiB)  TX bytes:6021 (5.8 KiB)

wmaster0  Link encap:UNSPEC  HWaddr 00-14-A5-2C-2E-8B-F4-EF-00-00-00-00-00-00-00-00  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

Comment 26 David Cantrell 2008-08-07 21:35:50 UTC
(In reply to comment #25)
> on another terminal:
> [root@sas ~]# ps axww|grep dhclient
>  6437 pts/0    S+     0:00 dhclient -d -v wlan0
>  6735 ?        S<s    0:00 /sbin/dhclient -1 -q -cf /etc/dhclient-wlan0.conf
> -lf /var/lib/dhclient/dhclient-wlan0.leases -pf /var/run/dhclient-wlan0.pid
> wlan0
>  6784 pts/1    S+     0:00 grep dhclient

You can't have multiple dhclient instances running for the same interface!

Kill all existing dhclient instances:

    pkill dhclient
    pkill -KILL dhclient

Check:

    ps -ef | grep dhclient

You should see no dhclients running.

Now, with that, run:

    dhclient -d -v wlan0

Comment 27 Levente Farkas 2008-08-07 21:45:19 UTC
:-) i like when i seems to stupid, so:
[root@sas ~]# ps ax|grep dhc; cat /etc/resolv.conf; dhclient -d -v wlan0
 8455 pts/0    R+     0:00 grep dhc
cat: /etc/resolv.conf: No such file or directory
Internet Systems Consortium DHCP Client 4.0.0
Copyright 2004-2007 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/

Listening on LPF/wlan0/00:14:a5:2c:2e:8b
Sending on   LPF/wlan0/00:14:a5:2c:2e:8b
Sending on   Socket/fallback
DHCPREQUEST on wlan0 to 255.255.255.255 port 67
DHCPACK from 192.168.182.1
bound to 192.168.182.9 -- renewal in 285 seconds.

on another terminal:
[root@sas ~]# ps ax|grep dhc; cat /etc/resolv.conf
 8457 pts/0    S+     0:00 dhclient -d -v wlan0
 8531 pts/1    S+     0:00 grep dhc
cat: /etc/resolv.conf: No such file or directory

anyway the second dhclient are also started by the system and not me!
but as it sees it still not working.

Comment 28 David Cantrell 2008-08-08 01:20:28 UTC
Anything in /var/log/messages?  What does /etc/dhclient.conf contain?  Is there also an /etc/dhclient-wlan0.conf file?  If so, what does it contain?  What does /etc/sysconfig/network-scripts/ifcfg-wlan0 contain?

Comment 29 Levente Farkas 2008-08-08 10:52:36 UTC
if your read my comment #18 then it's include everything. so
- this's my home laptop so i can't look into the messages right now
- there is no /etc/dhclient.conf just /etc/dhclient-wlan0.conf (see #18)
- ifcfg-wlan0 see #18

Comment 30 Fedora Update System 2008-08-12 18:27:14 UTC
dhcp-4.0.0-18.fc9 has been pushed to the Fedora 9 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update dhcp'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F9/FEDORA-2008-7234

Comment 31 Levente Farkas 2008-08-13 08:51:35 UTC
as i wrote in #18 already test it. everything after #18 is tested with version 4.0.0.18.

Comment 32 Fedora Update System 2008-09-16 23:25:48 UTC
dhcp-4.0.0-18.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 33 Levente Farkas 2008-09-27 15:16:36 UTC
as i wrote in #17 and after 4.0.0-18 is NOT working and the same problem exists!

Comment 34 David Cantrell 2008-09-27 22:45:47 UTC
From comment #18, your ifcfg-wlan0 contains PEERDNS=no.  Remove that line.  If PEERDNS=no in the ifcfg file, dhclient-script will not touch /etc/resolv.conf (either modifying or creating it).

Comment 35 Levente Farkas 2008-10-04 08:28:56 UTC
NOOOO! as i wrote even if i set PEERDNS=yes /etc/resolv.conf
 still contain \032.
anyway if i set PEERDNS=no then of course the /etc/resolv.conf won't change but i can't set static /etc/resolv.conf for all of my wireless access ponits:-(
please someone test it at least once before said it's fixed!

Comment 36 Will Woods 2008-10-10 16:12:27 UTC
You've got it misconfigured. Check the dhcp-options man page, specifically the section on "domain-list":

   The domain-list data type specifies a list of domain names, enclosed in
   double quotes and separated by commas ("example.com", "foo.example.com").

WRONG: supersede domain-search "lfarkas.org. int.bppiac.hu.";
RIGHT: supersede domain-search "lfarkas.org.", "int.bppiac.hu.";

See also these comments from Debian's bug system:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=492500#10
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=461056#42

Tested and confirmed - this works as described, *if* you use the correct syntax.

Comment 37 Levente Farkas 2008-10-20 19:25:14 UTC
ok it's may be not dhcp's fault just NetworkManager's #458555 but still not working:-(

Comment 38 Will Woods 2008-10-20 20:13:19 UTC
*** Bug 458555 has been marked as a duplicate of this bug. ***

Comment 39 Levente Farkas 2008-10-20 21:06:34 UTC
ok since i don't know which package's bug is it and you mark them as duplicate i reopen both.
the simple facts, that interface specific conf files are less usable:
----------------------------------------------
[root@sas ~]# cat /etc/dhclient-wlan0.conf 
supersede domain-name "lfarkas.org", "int.bppiac.hu", "bppiac.hu", "int.mkk.hu", "mkk.hu", "lenux.hu";
supersede domain-name-servers 192.168.0.2, 192.168.0.1, 192.168.182.1;
[root@sas ~]# cat /etc/resolv.conf
; generated by /sbin/dhclient-script
search key.chillispot.org
nameserver 192.168.253.1
nameserver 192.168.253.1
[root@sas ~]# cat /etc/sysconfig/network-scripts/ifcfg-wlan0 
# Please read /usr/share/doc/initscripts-*/sysconfig.txt
# for the documentation of these parameters.
TYPE=Wireless
DEVICE=wlan0
HWADDR=00:14:a5:2c:2e:8b
BOOTPROTO=dhcp
DHCP_HOSTNAME=
DOMAIN=
ONBOOT=yes
USERCTL=yes
#IPV6INIT=no
PEERDNS=yes
ESSID=
CHANNEL=
MODE=Managed
#RATE=54M
IPADDR=
NETMASK=
#NM_CONTROLLED=no
[root@sas ~]# ps axufww|grep dhclient|grep -v grep
root     10700  0.0  0.0   2516   608 ?        Ss   22:53   0:00 /sbin/dhclient -1 -q -cf /etc/dhclient-wlan0.conf -lf /var/lib/dhclient/dhclient-wlan0.leases -pf /var/run/dhclient-wlan0.pid wlan0
[root@sas ~]# rpm -qi dhclient
Name        : dhclient                     Relocations: (not relocatable)
Version     : 4.0.0                             Vendor: Fedora Project
Release     : 18.fc9                        Build Date: Wed 06 Aug 2008 09:44:44 PM CEST
Install Date: Wed 06 Aug 2008 10:49:44 PM CEST      Build Host: x86-2
Group       : System Environment/Base       Source RPM: dhcp-4.0.0-18.fc9.src.rpm
Size        : 552007                           License: ISC
Signature   : (none)
Packager    : Fedora Project
URL         : http://isc.org/products/DHCP/
Summary     : Provides the dhclient ISC DHCP client daemon and dhclient-script
Description :
DHCP (Dynamic Host Configuration Protocol) is a protocol which allows
individual devices on an IP network to get their own network
configuration information (IP address, subnetmask, broadcast address,
etc.) from a DHCP server. The overall purpose of DHCP is to make it
easier to administer a large network.

To use DHCP on your network, install a DHCP service (or relay agent),
and on clients run a DHCP client daemon.  The dhclient package
provides the ISC DHCP client daemon.
----------------------------------------------
what else should i've to show you?
so here is the messages log:
Oct 20 23:01:14 sas dhclient: /etc/dhclient-wlan0.conf line 1: semicolon expected.
Oct 20 23:01:14 sas dhclient: supersede domain-name "lfarkas.org",
Oct 20 23:01:14 sas dhclient:                                    ^
Oct 20 23:01:14 sas dhclient: /etc/dhclient-wlan0.conf line 1: expecting a statement.
Oct 20 23:01:14 sas dhclient: supersede domain-name "lfarkas.org", "int.bppiac.hu", "bppiac.hu", "int.mkk.hu",
Oct 20 23:01:14 sas dhclient: /etc/dhclient-wlan0.conf line 2: semicolon expected.
Oct 20 23:01:14 sas dhclient: 
Oct 20 23:01:14 sas dhclient: ^
Oct 20 23:01:15 sas kernel: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
Oct 20 23:01:16 sas dhclient: DHCPREQUEST on wlan0 to 255.255.255.255 port 67
Oct 20 23:01:16 sas dhclient: DHCPACK from 192.168.182.1
Oct 20 23:01:16 sas NET[11509]: /sbin/dhclient-script : updated /etc/resolv.conf
Oct 20 23:01:16 sas dhclient: bound to 192.168.182.16 -- renewal in 256 seconds.
----------------------------------------------
are you _absolutely_ sure about this syntax????

Comment 40 Will Woods 2008-10-20 21:22:08 UTC
Yes. You've got the syntax wrong again. Read the log messages:

> Oct 20 23:01:14 sas dhclient: /etc/dhclient-wlan0.conf line 1: semicolon expected.
> Oct 20 23:01:14 sas dhclient: supersede domain-name "lfarkas.org",

So that should be:
supersede domain-name "lfarkas.org";
The lines should end with a semicolon, not a comma.

Futhermore, that config line doesn't even appear in your earlier output: 

>   [root@sas ~]# cat /etc/dhclient-wlan0.conf 
> supersede domain-name "lfarkas.org", "int.bppiac.hu", "bppiac.hu", "int.mkk.hu", "mkk.hu", "lenux.hu";
> supersede domain-name-servers 192.168.0.2, 192.168.0.1, 192.168.182.1;

So those log messages don't match the config file you showed us.

You are creating broken config files. That is not a bug. And it's not the original bug reported here either.

Do not reopen this bug unless you can cause "\032" to appear in your resolv.conf with a *valid* config file.

Comment 41 Will Woods 2008-10-20 21:38:03 UTC
*** Bug 458555 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.