better umask handling

This commit is contained in:
roberto@precise64
2012-02-17 17:58:46 +01:00
parent de25db9e75
commit fb4fc38f14
3 changed files with 6 additions and 1 deletions
+3 -1
View File
@@ -171,7 +171,9 @@ void daemonize(char *logfile) {
exit(0);
}
umask(0);
if (!uwsgi.do_not_change_umask) {
umask(0);
}
/*if (chdir("/") != 0) {
uwsgi_error("chdir()");
+2
View File
@@ -3365,6 +3365,8 @@ void uwsgi_opt_set_umask(char *opt, char *value, void *mode) {
umask_mode = (umask_mode << 3) + (value[3] - '0');
}
umask(umask_mode);
uwsgi.do_not_change_umask = 1;
}
+1
View File
@@ -1191,6 +1191,7 @@ struct uwsgi_server {
struct uwsgi_string_list *static_index;
char *daemonize;
int do_not_change_umask;
char *logfile;
int logfile_chown;