kppp not resolvconf-aware; appears to clobber /etc/resolvconf

Bug #1086336 reported by Thomas Hood on 2012-12-04
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kdenetwork (Ubuntu)
Undecided
Unassigned

Bug Description

Looking at the kdenetwork 4.9.2-0ubuntu2.1 source code I see the following code snippets in kppp/connect.cpp starting at line 1419:

    // Replace the DNS domain entry in the /etc/resolv.conf file and
    // disable the nameserver entries if option is enabled
    void add_domain(const QString &domain) {

    // adds the DNS entries in the /etc/resolv.conf file
    void adddns()
    {

    // remove the dns entries from the /etc/resolv.conf file
    void removedns() {

The code inside the functions writes directly to /etc/resolv.conf. Nowhere is there a check for the presence of /sbin/resolvconf.

When /sbin/resolvconf is present and executable, and thus in Ubuntu 12.04 and later, it is not permitted to write directly to /etc/resolv.conf. Programs that want to make changes to resolv.conf must interface with /sbin/resolvconf which takes care of adding material to and removing material from resolv.conf. Please see /usr/share/doc/resolvconf/README.gz for more instructions.

It looks as if kppp writes to /etc/resolv.conf and does not mv /etc/resolv.conf. So if /etc/resolv.conf is a symbolic link, as is normally the case when resolvconf is installed, then kppp will write through the link to /run/resolvconf/resolv.conf. Then the next time resolvconf updates this file, kppp's changes will be obliterated.

I haven't tested kppp so I don't know whether the code in question is actually executed. If I have a chance I'll test it.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers