2006-05-05 Robert Love <rml@novell.com>
* src/NetworkManager.c: Set the umask to 0022 when daemonizing, in case root has a wacky default of its own (or, more common, a user has a bad umask and uses su/sudo to restart NetworkManager). Anything other than 0022 does not do what we want with, for example, resolv.conf. This problem is amplified by our judicious use of fopen(), which uses mode 0666 -- implying that the only way to get the permissions we want is with a umask of 0022. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1719 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
10
ChangeLog
10
ChangeLog
@@ -1,3 +1,13 @@
|
||||
2006-05-05 Robert Love <rml@novell.com>
|
||||
|
||||
* src/NetworkManager.c: Set the umask to 0022 when daemonizing, in case
|
||||
root has a wacky default of its own (or, more common, a user has a
|
||||
bad umask and uses su/sudo to restart NetworkManager). Anything other
|
||||
than 0022 does not do what we want with, for example, resolv.conf. This
|
||||
problem is amplified by our judicious use of fopen(), which uses mode
|
||||
0666 -- implying that the only way to get the permissions we want is
|
||||
with a umask of 0022.
|
||||
|
||||
2006-05-05 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
* gnome/libnm_glib/libnm_glib.c
|
||||
|
@@ -743,6 +743,13 @@ int main( int argc, char *argv[] )
|
||||
write_pidfile (pidfile);
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the umask to 0022, which results in 0666 & ~0022 = 0644.
|
||||
* Otherwise, if root (or an su'ing user) has a wacky umask, we could
|
||||
* write out an unreadable resolv.conf.
|
||||
*/
|
||||
umask (022);
|
||||
|
||||
g_type_init ();
|
||||
if (!g_thread_supported ())
|
||||
g_thread_init (NULL);
|
||||
|
Reference in New Issue
Block a user