Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#14876 - [ppp] script sets resolv.conf rights wrong

Attached to Project: Arch Linux
Opened by Pasi Luostarinen (betek) - Saturday, 30 May 2009, 07:52 GMT
Last edited by Jan de Groot (JGC) - Monday, 09 November 2009, 08:01 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Thomas Bächler (brain0)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

when pppd gets and ip address the /etc/ppp/ip-up is called and that calls /etc/ppp/ip-up.d/00-dns.sh script that copies new resolv.conf file to /etc. The resolv.conf have only read rights to root so users cannot use dns anymore. one sollution would be to add chmod ugo+r /etc/resolv.conf line to 00-dns.sh script.

This task depends upon

Closed by  Jan de Groot (JGC)
Monday, 09 November 2009, 08:01 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fixed in 2.4.4-9.
Comment by Thomas Bächler (brain0) - Saturday, 30 May 2009, 20:24 GMT
It doesn't set the right at all, that is the problem - which worked here iirc.
Comment by Thomas Bächler (brain0) - Saturday, 30 May 2009, 20:25 GMT
Do you have a custom umask set at the point where you launch pppd? That would cause the problem ... introducing a chmod 644 into the dns script should help anyway.
Comment by Pasi Luostarinen (betek) - Sunday, 31 May 2009, 10:48 GMT
Yes I have custom umask (umask 066). But I think that it should change the rights since I run pon script in a shell so should I change my umask every time that I run the script? I think not.
Comment by Heiko Baums (cyberpatrol) - Friday, 10 July 2009, 08:49 GMT
I have the same issue since the update of ppp 2.4.4-8 in conjunction with rp-pppoe 3.10-1 and filesystem 2009.01-2. Downgrading to ppp 2.4.4-7 helped before, but now it doesn't help anymore.

In the past resolv.conf was saved in /etc/ppp with the permissions root:root 644 as needed and a symlink to this file was set in /etc.

Now resolv.conf is saved directly in /etc, but with the permissions root:root 600. If I chmod this file to 644 manually, the permissions are always reset to 600, if I disconnect with pppoe-stop and reconnect with pppoe-start.

As a workaround I had to modify the script /usr/sbin/pppoe-start and add a `chmod 644 /etc/resolv.conf` after the "Connected!" message.
Comment by Heiko Baums (cyberpatrol) - Friday, 10 July 2009, 08:51 GMT
Btw., umask for my user root is set to 022. So this is not a umask issue.
Comment by Thomas Bächler (brain0) - Friday, 10 July 2009, 11:33 GMT
This is bad anyway, as rp-pppoe shouldn't even touch that, because initializing the ppp connection (including ip-up handling and settings) is a problem of pppd, not of rp-pppoe. The fact that rp-pppoe does DNS handling at all (apparently by setting that symlink) is a bug on its own.

I won't deal with rp-pppoe's stupidness at all (the package is superfluous anyway, so I'll completely ignore it) and only fix this in ppp by adding a proper chmod call to the 00-dns.sh script. I don't know when I'll get to that, in the meantime add a chmod 644 /etc/resolv.conf at the end of /etc/ppp/ip-up.d/00-dns.sh.
Comment by Heiko Baums (cyberpatrol) - Friday, 10 July 2009, 13:28 GMT
I, too, don't think, that this is rp-pppoe related. But if you want to add a chmod to the 00-dns.sh script, I'd suggest to remove this file completely, because it's generally superfluous.

I don't think, that creating a backup of resolv.conf at every ppp(oe) connection is necessary, especially because this backup is still saved in /etc/ppp. Though /etc/ppp/resolv.conf is always copied to /etc. Why not keep /etc/ppp/resolv.conf as a backup (also not really necessary) and keep /etc/resolv.conf untouched. I'd say this would be more KISS like and save disk space. If someone needs more copies of resolv.conf for different DNS servers, these copies can be made manually.
Comment by Heiko Baums (cyberpatrol) - Friday, 10 July 2009, 13:31 GMT
I just see, that the backup of resolv.conf is written back to resolv.conf at disconnection by /etc/ppp/ip-down.d/00-dns.sh. This file could or should be removed, too, if /etc/ppp/ip-up.d/00-dns.sh will be removed.
Comment by Thomas Bächler (brain0) - Friday, 10 July 2009, 15:05 GMT
No, this is necessary. If you establish a ppp connection with USEPEERDNS, the upstream DNS server will not be set unless you move /etc/ppp/resolv.conf to /etc/. Apps like wvdial, kppp or plain ppp with a config file rely on that. The fact that rp-pppoe does a job that ppp should do is simply wrong.
Comment by Heiko Baums (cyberpatrol) - Friday, 10 July 2009, 16:24 GMT
I uninstalled rp-pppoe and configured ppp with rp-pppoe.so. If I now connect with pon and disconnect with poff, the permissions of /etc/resolv.conf aren't changed anymore. Maybe the first time they were set to 600 - I didn't pay attention - but the permissions aren't changed anymore at dial-up. I also tried to connect with networkmanager. The same here. The script /etc/ppp/ip-up.d/00-dns.sh seems to be executed, but the permissions of /etc/resolv.conf haven't been changed. So I guess my problem was related to rp-pppoe maybe in conjunction with some possible changes in ppp. So I'd suggest not to add the chmod to the script /etc/ppp/ip-up.d/00-dns.sh but to /usr/sbin/pppoe-start.
Comment by Thomas Bächler (brain0) - Friday, 10 July 2009, 16:32 GMT
The chmod is necessary anyway in case of non-standard umasks (betek's original problem), adding it won't hurt then.
Comment by Thomas Bächler (brain0) - Friday, 10 July 2009, 22:31 GMT
Should be fixed in ppp 2.4.4-9 in testing.

Loading...