Bug 9482 - /etc/resolv.conf created with readonly root permissions
/etc/resolv.conf created with readonly root permissions
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
6.1
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Nalin Dahyabhai
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-02-16 11:42 EST by smuskiew
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-03-20 11:11:59 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description smuskiew 2000-02-16 11:42:12 EST
When rp3 is used with a dialup connection that specifies DNS servers, it
creates a new /etc/resolv.conf with those servers, but the permissions on
the file are 600, so DNS lookups by any other users fail.

Also, if there is already an /etc/resolv.conf before rp3 is used, shouldn't
it save the original file somewhere and then restore it once the connection
is closed?
Comment 1 Nalin Dahyabhai 2000-02-29 08:46:59 EST
Restoring the previous contents of /etc/resolv.conf becomes very difficult if
you start mixing multiple PPP interfaces, so it's not something I expect rp3
will be able to do any time soon, if ever.

The resolv.conf is modified by the ifup-post script, which takes pains to
maintain the existing permissions on the file.  If you use chmod to reset the
permissions to 0644, does it get changed back to mode 0600 when you bring up a
PPP interface?
Comment 2 smuskiew 2000-02-29 10:16:59 EST
It seems to be ok on preserving permissions if /etc/resolv.conf exists
beforehand, but if the file doesn't exist before dialing, the new one it
creates gets 600 permissions.
Comment 3 Nalin Dahyabhai 2000-03-06 10:10:59 EST
What is your umask set to (i.e., what does running "umask" print) when you bring
up the interface?  The permissions set on new files can never include those in
your umask, so if your umask is set to 077, then the file can't be created with
permissions greater than 0600.
Comment 4 smuskiew 2000-03-09 15:54:59 EST
"umask" for root (right before invoking rp3) is '022'.

Also I have confirmed that if rp3 is run when no /etc/resolv.conf
exists, the created file gets permissions 600.  But if it previously
existed, the permissions are correctly preserved.
Comment 5 Nalin Dahyabhai 2000-03-09 17:42:59 EST
Ugh.  As far as I can tell, rp3 and wvdial never directly modify this file, and
leave it to the initscripts package's scripts to do the work.  Initscripts
doesn't modify the file permissions either way, so files that get created get
the default permissions, and permissions on pre-existing files remain unchanged.

I suspect that somewhere in the whole rp3->wvdial->ifup->ifup-post chain of
execution something is changing the default umask to 077.  Putting a fix into
initscripts is probably the best way to work around the problem.
Comment 6 Bill Nottingham 2000-03-20 11:11:59 EST
Fixed in initscripts-5.02-1.

Note You need to log in before you can comment on or make changes to this bug.