Comment 6 for bug 11626

Revision history for this message
In , Thomas Hood (jdthood-aglu) wrote : Re: if there is nothing, you might as well close it

reassign 288481 webmin-wvdial
thanks

On Wed, 2005-01-05 at 11:56 +0100, Malte Schmidt-Tychsen wrote:
> maybe I will try to reproduce it today. I used webmin-wvdial and the bug
> could be located anywhere. webmin-wvdial, wvdial, ppp-tools, ifplugd ...

I have found the culprit: webmin-wvdial. The evil code is
in /usr/share/webmin/wvdial/ppp-client-lib.pl:

    $resolv_conf = "/etc/resolv.conf";
    $ppp_resolv_conf = "/etc/ppp/resolv.conf";
    $save_resolv_conf = $resolv_conf.".save";
    [...]
    if ($connected && $autodns) {
        # If the resolv.conf file has not been modified, and the PPP
        # resolv.conf has, copy it into place
    [...]
                        # A PPP DNS config has been created .. use it
                        &system_logged("cp $resolv_conf $save_resolv_conf")
                                if (!-l $resolv_conf);
                        unlink($resolv_conf);
                        &system_logged("cp $ppp_resolv_conf $resolv_conf");
    [...]
    sub ppp_disconnect
    {
    [...]
            # Restore the saved DNS config file, if it hasn't been done
    [...]
            if (!-l $resolv_conf && $ost[9] < time()-5 && -r $save_resolv_conf) {
                &system_logged("mv $save_resolv_conf $resolv_conf");
                if ($_[1] == 0) {
                        print "$text{'disc_dns'}<p>\n";
                        }
                elsif ($_[1] == 1) {
                        print "$text{'disc_dns'}\n\n";
                        }
                }
                &system_logged("rm -f $ppp_resolv_conf");
                return 1;
            }
    [...]
    }

I don't know why webmin-wvdial tries to do this. If the user
wants /etc/resolv.conf to be a copy of /etc/ppp/resolv.conf then she can
simply make the former a symlink to the latter.

More relevant to you and me, this code isn't compatible with resolvconf
which requires that /etc/resolv.conf remain a symlink
to /etc/resolvconf/run/resolv.conf.

Furthermore, the code is buggy. If /etc/resolv.conf is originally a
symlink then it won't be restored as a symlink. If /etc/ppp/resolv.conf
is originally a symlink then this code will delete it.

This whole "feature" should be commented out.

--
Thomas Hood <email address hidden>