mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-24 21:50:17 +01:00
main: Set umask earlier
Since we may be creating e.g. pid files before this, we need to set the umask as early as possible.
This commit is contained in:
parent
4ff7eeeaae
commit
d3fd1b7464
1 changed files with 7 additions and 7 deletions
14
src/main.c
14
src/main.c
|
|
@ -339,6 +339,13 @@ main (int argc, char *argv[])
|
|||
*/
|
||||
setenv ("GIO_USE_VFS", "local", 1);
|
||||
|
||||
/*
|
||||
* 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);
|
||||
|
||||
if (!g_module_supported ()) {
|
||||
fprintf (stderr, _("GModules are not supported on your platform!\n"));
|
||||
exit (1);
|
||||
|
|
@ -478,13 +485,6 @@ main (int argc, char *argv[])
|
|||
g_log_set_always_fatal (fatal_mask);
|
||||
}
|
||||
|
||||
/*
|
||||
* 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 ();
|
||||
dbus_threads_init_default ();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue