martin      00/01/31 15:14:45

  Modified:    src/main http_log.c
  Log:
  Enforce a sensible permission on the httpd.pid file.
  Submitted by: Frank Miller <[EMAIL PROTECTED]>
  Reviewed by:  Martin Kraemer
  
  Revision  Changes    Path
  1.27      +10 -0     apache-2.0/src/main/http_log.c
  
  Index: http_log.c
  ===================================================================
  RCS file: /export/home/cvs/apache-2.0/src/main/http_log.c,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- http_log.c        2000/01/19 01:15:06     1.26
  +++ http_log.c        2000/01/31 23:14:41     1.27
  @@ -475,6 +475,9 @@
       ap_finfo_t finfo;
       static pid_t saved_pid = -1;
       pid_t mypid;
  +#ifndef WIN32
  +    mode_t u;
  +#endif
   
       if (!fname) 
        return;
  @@ -496,6 +499,10 @@
                               );
       }
   
  +#ifndef WIN32
  +    u = umask(022);
  +    (void) umask(u | 022);
  +#endif
       if(ap_open(&pid_file, fname, APR_WRITE | APR_CREATE, APR_OS_DEFAULT, p) 
!= APR_SUCCESS) {
        perror("fopen");
           ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, 
  @@ -503,6 +510,9 @@
                     ap_server_argv0, fname);
           exit(1);
       }
  +#ifndef WIN32
  +    (void) umask(u);
  +#endif
       ap_fprintf(pid_file, "%ld\n", (long)mypid);
       ap_close(pid_file);
       saved_pid = mypid;
  
  
  

Reply via email to