Set umask before mkstemp() for some versions of glibc

This commit is contained in:
Mukund Sivaraman 2008-08-24 11:27:38 +05:30
parent 62ddbd5e74
commit fce253253a
2 changed files with 6 additions and 1 deletions

View File

@ -42,7 +42,7 @@ makedaemon(void)
exit(0);
chdir("/");
umask(077);
umask(0177);
#if NDEBUG
/*

View File

@ -188,6 +188,11 @@ main(int argc, char **argv)
}
#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 */
config.config_file = DEFAULT_CONF_FILE;