]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
make sure pid file is world readable
authorwessels <>
Sun, 15 Dec 1996 10:22:28 +0000 (10:22 +0000)
committerwessels <>
Sun, 15 Dec 1996 10:22:28 +0000 (10:22 +0000)
src/tools.cc

index c3219a67d833a0cc0696e276a8eb96bf1b165442..f274ad5344d00c84307c9ca878037f90dd0d9b84 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: tools.cc,v 1.90 1996/12/02 05:55:11 wessels Exp $
+ * $Id: tools.cc,v 1.91 1996/12/15 03:22:28 wessels Exp $
  *
  * DEBUG: section 21    Misc Functions
  * AUTHOR: Harvest Derived
@@ -526,11 +526,14 @@ writePidFile(void)
 {
     FILE *pid_fp = NULL;
     const char *f = NULL;
+    mode_t old_umask;
 
     if ((f = Config.pidFilename) == NULL || !strcmp(Config.pidFilename, "none"))
        return;
     enter_suid();
+    old_umask = umask(022);
     pid_fp = fopen(f, "w");
+    umask(old_umask);
     leave_suid();
     if (pid_fp != NULL) {
        fprintf(pid_fp, "%d\n", (int) getpid());