Set umask before mkstemp() for some versions of glibc
This commit is contained in:
parent
62ddbd5e74
commit
fce253253a
@ -42,7 +42,7 @@ makedaemon(void)
|
|||||||
exit(0);
|
exit(0);
|
||||||
|
|
||||||
chdir("/");
|
chdir("/");
|
||||||
umask(077);
|
umask(0177);
|
||||||
|
|
||||||
#if NDEBUG
|
#if NDEBUG
|
||||||
/*
|
/*
|
||||||
|
@ -188,6 +188,11 @@ main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
#endif /* HAVE_SETRLIMIT */
|
#endif /* HAVE_SETRLIMIT */
|
||||||
|
|
||||||
|
/* Only allow u+rw bits. This may be required for some versions
|
||||||
|
* of glibc so that mkstemp() doesn't make us vulnerable.
|
||||||
|
*/
|
||||||
|
umask(0177);
|
||||||
|
|
||||||
/* Default configuration file location */
|
/* Default configuration file location */
|
||||||
config.config_file = DEFAULT_CONF_FILE;
|
config.config_file = DEFAULT_CONF_FILE;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user