wicd-1.7.1 causes stdin error on dhclient
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
wicd |
New
|
Undecided
|
Unassigned |
Bug Description
System: Gentoo Linux (amd64) with wicd-1.7.1 and dhcp-4.2.3.
Using wicd-1.7.1 with dhclient (as only DHCP client available on my system) doesn't work either for wired connections or wireless connections. On the simplest scenario, wired connection to a DHCP router on my lan with nothing fancy, a wire on eth0 and automatic dhcp connection, an error "could not get an IP address" is reported on the GTK interface.
However, on the log, dhclient reports an error on reading the stdin:
=======Part of wicd.log=
Internet Systems Consortium DHCP Client 4.2.3-P1 Gentoo-r0
Copyright 2004-2011 Internet Systems Consortium.
All rights reserved.
For info, please visit https:/
failed to read stdin!
This version of ISC DHCP is based on the release available
on ftp.isc.org. Features have been added and other changes
have been made to the base software release in order to make
it work better with this distribution.
Please report for this software via the Gentoo Bugzilla site:
http://
exiting.
DHCP connection failed
exiting connection thread
Sending connection attempt result dhcp_failed
=======
A bug on dhclient itself is discarded as it works flawslessly from the command line. Running "dhclient eth0" just works. Therefore, I looked into the wicd side trying to figure out the source of the problem.
The call to dhclient is done in the misc.Run function, located in wicd/misc.py using Popen
=======
143: try:
144: f = Popen(cmd, shell=False, stdout=PIPE, stdin=std_in, stderr=err,
145: close_fds=fds, cwd='/', env=tmpenv)
=======
There, the stdin argument depends on the std_in variable, which is set based on the value of return_obj in wicd/misc.py
=======
132: if return_obj:
133: std_in = PIPE
134: else:
135: std_in = None
=======
The call to misc.Run for dhclient sets return_obj=True and, therefore, the stdin argument is set to PIPE in Popen. Somehow the PIPE object is causing dhclient to fail in my system with the mentioned error about reading the stdin.
I fixed this problem in my system by changing, in the Popen call, the stdin argument to stdin=None, now dhclient is working and I can connect to both wired and wireless networks. But I don't know if this is the proper fix.
Related branches
- Pieter Leclerc (community): Needs Fixing
-
Diff: 32 lines (+12/-3)1 file modifiedwicd/wnettools.py (+12/-3)
This bug still applies to wicd-1.7.2.1