Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 25476 - Squid dies because of permissions on /etc/resolv.conf
Summary: Squid dies because of permissions on /etc/resolv.conf
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High critical (vote)
Assignee: Gentoo Dialup Developers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-28 19:48 UTC by Steven Elling
Modified: 2004-04-26 03:34 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steven Elling 2003-07-28 19:48:29 UTC
When using pppd with squid the permissions on /etc/resolv.conf get changed to 640. 
 
The rc init script /etc/init.d/net.ppp0 echos the command "chmod 640 /etc/resolv.conf" 
into /etc/ppp/ip-up, which causes the permissions on /etc/resolv.conf to be changed to 
640 when the connection comes up.  This causes squid to die or not start at all. 
 
Running 'squid -N -d 1' shows the following: 
 
2003/07/28 21:31:14| Starting Squid Cache version 2.5.STABLE3 for 
i686-pc-linux-gnu... 
2003/07/28 21:31:14| Process ID 2075 
2003/07/28 21:31:14| With 1024 file descriptors available 
2003/07/28 21:31:14| Performing DNS Tests... 
2003/07/28 21:31:14| Successful DNS name lookup tests... 
2003/07/28 21:31:14| DNS Socket created at 0.0.0.0, port 1026, FD 4 
2003/07/28 21:31:14| /etc/resolv.conf: (13) Permission denied 
FATAL: Could not find any nameservers. 
       Please check your /etc/resolv.conf file 
       or use the 'dns_nameservers' option in squid.conf. 
Aborted 
===== 

Reproducible: Always
Steps to Reproduce:
1. Start the pppd daemon via /etc/init.d/net.ppp0 
2. Establish an Internet connection. 
3. Start the squid daemon via /etc/init.d/squid 
Actual Results:  
/var/log/daemon.log showed several failures for squid with the following final error: 
 
Jul 28 06:30:12 firewall squid[1073]: Exiting due to repeated, frequent failures 

Expected Results:  
Squid should be able to start and not die. 

The rc init script /etc/init.d/net.ppp0 should echo the command "chmod 644 
/etc/resolv.conf" into /etc/ppp/ip-up. 
 
Also, if the permission are set to 640, users (except root) and non-root daemons can not 
do DNS lookups.
Comment 1 Martin Holzer (RETIRED) gentoo-dev 2003-07-29 13:29:57 UTC
ls -la /etc/resolv.conf
-rw-r--r--    1 root     root          103 Jun 25 15:59 /etc/resolv.conf


must me something with ppp
Comment 2 Martin Schlemmer (RETIRED) gentoo-dev 2003-08-21 13:18:06 UTC
Martin, know what Chuck Brewer's email is ?  killian@g.o do not work, and he
looks more after ppp these days ...
Comment 3 Chris Russell (RETIRED) gentoo-dev 2003-09-20 23:30:59 UTC
this caught me today when setting up my laptop to take on vacation... (yay)
/etc/init.d/net.ppp0 does indeed chmod 640 /etc/resolv.conf and since /etc/resolv.conf's ownership is root:root no users can resolve names after bringing up the ppp link.

I'd also propose chmod 644 in /etc/init.d/net.ppp0

I can't see an issue with resolv.conf keeping o+r perms, anyone else?

also reported in bug 26311
Comment 4 Jean Jordaan 2004-02-07 04:45:21 UTC
This was biting me now. I ended up modifying /etc/init.d/net.ppp0 to chmod 644 before discovering this bug report. I see last activity here is from 2003-09-20 --- is anything blocking resolution (e.g. s/640/644/ )?
Comment 5 Bob Black 2004-04-14 23:08:27 UTC
What about your umask in /etc/profile?
Comment 6 Steven Elling 2004-04-18 08:03:39 UTC
umask 022
Comment 7 Steven Elling 2004-04-18 08:07:19 UTC
The umask would have nothing to do with this problem because I determined the problem was because of the net.ppp0 rc init script.
Comment 8 Heinrich Wendel (RETIRED) gentoo-dev 2004-04-19 03:13:07 UTC
what's your ppp version=
Comment 9 Heinrich Wendel (RETIRED) gentoo-dev 2004-04-26 03:34:54 UTC
i think this is caused because you don't updated the net.ppp0 init.d file after updating ppp