Bug 14504 - ifup-post can create unreadable /etc/resolv.conf
Summary: ifup-post can create unreadable /etc/resolv.conf
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: initscripts
Version: 6.2
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-07-24 06:41 UTC by Mike Perry
Modified: 2014-03-17 02:14 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2000-07-24 16:29:50 UTC
Embargoed:


Attachments (Terms of Use)

Description Mike Perry 2000-07-24 06:41:21 UTC
When called with an stringent umask (066, for example) ifup-post can create
an unreadable /etc/resolv.conf if one doesn't already exist. Obviously,
this breaks DNS for unpriveledged users. Are there any other config files
created by the if* scripts that have a similar problem? This is the only
one I've noticed so far.
 
Simply setting the umask before catting to resolv.conf, or chmoding
afterwords will fix this.

diff -ur initscripts-5.00/sysconfig/network-scripts/ifup-post
initscripts-5.00sym/sysconfig/network-scripts/ifup-post
--- initscripts-5.00/sysconfig/network-scripts/ifup-post        Thu Feb 24
12:09:39 2000
+++ initscripts-5.00sym/sysconfig/network-scripts/ifup-post     Mon Jul 24
01:38:31 2000
@@ -74,7 +74,10 @@
     done
     
     # maintain permissions
+    oldmask=`umask`
+    umask 022
     cat $tr > /etc/resolv.conf
+    umask $oldmask
     rm -f $tr
   fi
 fi

Comment 1 Bill Nottingham 2000-07-24 16:29:48 UTC
Hm, this will only be the case if resolv.conf isn't
created already, as far as I can tell. We'll get
this change in, but for most cases it should be
unnecessary.

Comment 2 Bill Nottingham 2000-08-07 04:51:24 UTC
Actually, this has been fixed for a while in rawhide.


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