Return-Path: Delivered-To: apache-cvs-archive@hyperreal.org Received: (qmail 26388 invoked by uid 6000); 31 Jan 2000 23:14:58 -0000 Received: (qmail 26232 invoked by uid 2016); 31 Jan 2000 23:14:53 -0000 Delivered-To: apcore-apache-2.0-cvs@apache.org Received: (qmail 26135 invoked by uid 177); 31 Jan 2000 23:14:47 -0000 Date: 31 Jan 2000 23:14:47 -0000 Message-ID: <20000131231447.26134.qmail@hyperreal.org> From: martin@hyperreal.org To: apache-2.0-cvs@apache.org Subject: cvs commit: apache-2.0/src/main http_log.c Sender: apache-cvs-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org 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 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;