From 93a6d2f3a76ef62f5a450c7fb7c8fd4166384c65 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 12 Jun 2000 21:08:25 +0000 Subject: [PATCH] Back out ap_set_default_perms(). Remove old logic to play with umask around the creation of the httpd.pid file. Pass explicit permissions to ap_open(), omitting write-ability except by the owning user. As always, we end up with rw-r--r-- for the permissions unless the umask is something unusual. Note that the OS/2 and Win32 implementations of ap_open() ignore the permissions parameter altogether. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85550 13f79535-47bb-0310-9956-ffa450edef68 --- server/log.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/server/log.c b/server/log.c index 11dd2f1b19..248f497cc0 100644 --- a/server/log.c +++ b/server/log.c @@ -490,9 +490,6 @@ void ap_log_pid(ap_pool_t *p, const char *fname) ap_finfo_t finfo; static pid_t saved_pid = -1; pid_t mypid; -#ifndef WIN32 - mode_t u; -#endif if (!fname) return; @@ -514,21 +511,14 @@ void ap_log_pid(ap_pool_t *p, const char *fname) ); } -#ifndef WIN32 - 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) { + APR_UREAD | APR_UWRITE | APR_GREAD | APR_WREAD, p) != APR_SUCCESS) { perror("fopen"); ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, "%s: could not log pid to file %s", ap_server_argv0, fname); exit(1); } -#ifndef WIN32 - (void) ap_set_default_fperms(u); -#endif ap_fprintf(pid_file, "%ld\n", (long)mypid); ap_close(pid_file); saved_pid = mypid; -- 2.40.0