From: Ryan Bloom Date: Mon, 12 Jun 2000 16:00:33 +0000 (+0000) Subject: Add a new function ap_set_default_fperms. This allows people to set the X-Git-Tag: APACHE_2_0_ALPHA_5~359 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b44c18edd7a8187d26e3bbf8555033bebec1ba20;p=apache Add a new function ap_set_default_fperms. This allows people to set the umask to be used when creating files. This should change the permissions of files created using APR_DEFAULT_OS. Also removed a warning introduced with the sys/stat.h changes. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85537 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/log.c b/server/log.c index 9e8d6c93ed..11dd2f1b19 100644 --- a/server/log.c +++ b/server/log.c @@ -515,8 +515,8 @@ void ap_log_pid(ap_pool_t *p, const char *fname) } #ifndef WIN32 - u = umask(022); - (void) umask(u | 022); + u = ap_set_default_fperms(022); + (void) ap_set_default_fperms(u | 022); #endif if (ap_open(&pid_file, fname, APR_WRITE | APR_CREATE | APR_TRUNCATE, APR_OS_DEFAULT, p) != APR_SUCCESS) { @@ -527,7 +527,7 @@ void ap_log_pid(ap_pool_t *p, const char *fname) exit(1); } #ifndef WIN32 - (void) umask(u); + (void) ap_set_default_fperms(u); #endif ap_fprintf(pid_file, "%ld\n", (long)mypid); ap_close(pid_file);