Set umask before mkstemp() for some versions of glibc

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

No files matched your search

+1 -1
View File
@@ -42,7 +42,7 @@ makedaemon(void)
exit(0);
chdir("/");
umask(077);
umask(0177);
#if NDEBUG
/*
+5
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;