]> granicus.if.org Git - apache/commitdiff
Back out ap_set_default_perms(). Remove old logic to play with umask
authorJeff Trawick <trawick@apache.org>
Mon, 12 Jun 2000 21:08:25 +0000 (21:08 +0000)
committerJeff Trawick <trawick@apache.org>
Mon, 12 Jun 2000 21:08:25 +0000 (21:08 +0000)
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

index 11dd2f1b19e8889c1159146e594838ff0b547ab4..248f497cc0f3e3f62c4c6c18f14b9de266500d7b 100644 (file)
@@ -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;