Backing up resolv.conf fails if readlink returns relative path
Bug #1295253 reported by
John Chadwick
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
wicd |
New
|
Undecided
|
Unassigned |
Bug Description
I had an issue where wicd was unable to start because it was trying to back up resolv.conf, but the symlink path was relative. It appears instead of using os.readlink to find the destination of a link, it's better to use os.path.realpath, which always returns an absolute path. A simple replacement fixed the problem for me.
I also noticed that wicd would fail to start if /var/lib/
To post a comment you must log in.
This bug has affected me as well (Ubuntu 13.10, wicd 1.7.2.4 (bzr-r768)). My resolv.conf was a symlink to "../run/ resolvconf/ resolv. conf".
While trying to debug the issue, I also noticed that the try block is ended by a "except IOError", but the errors that may arise either by the symlink being present but invalid (in which case os.symlink(dest, backup_location) will fail) or created by this session (in which case os.chmod( backup_ location, 0644) will fail) are OSError, and not IOError. Maybe this exception class should be added to the except clause?