wicd-daemon.py clobbers /etc/resolv.conf

Bug #1073695 reported by Thomas Hood
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
wicd (Debian)
Fix Released
Unknown
wicd (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

In wicd-daemon.py the main() function backs up and restores /etc/resolv.conf. To back up it does

    shutil.copy2('/etc/resolv.conf', wpath.varlib + 'resolv.conf.orig')

which is like the following shell command.

   cp -p /etc/resolv.conf path/resolv.conf.orig

Note that if /etc/resolv.conf is a symbolic link to another file, the shutil.copy2() copies the contents to the target; it does not create an equivalent symbolic link at the target.

To restore, it does

    shutil.move(wpath.varlib + 'resolv.conf.orig', '/etc/resolv.conf')

which is like the following.

    mv path/resolv.conf.orig /etc/resolv.conf

If /etc/resolv.conf was a symbolic link before the backup-and-restore sequence then afterwards it is a plain file with the contents of the target of that symlink. Put more bluntly, it clobbers the symlink.

Resolvconf, which is part of the Ubuntu base install since 12.04, makes use of a symbolic link /etc/resolv.conf -> ../run/resolvconf/resolv.conf. Therefore it appears that wicd-daemon.py will break any system using resolvconf, i.e., the majority of Ubuntu systems since 12.04.

I was just reading the wicd code and this bug report arises from that reading, not from testing. But even if the code in question isn't currently executed it should be fixed.

Changed in wicd (Debian):
status: Unknown → Confirmed
Changed in wicd (Debian):
status: Confirmed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in wicd (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.