From: wessels <> Date: Sun, 15 Dec 1996 10:22:28 +0000 (+0000) Subject: make sure pid file is world readable X-Git-Tag: SQUID_3_0_PRE1~5292 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=973e9fe1a5c9ceb92a056271e115be76f75abe67;p=thirdparty%2Fsquid.git make sure pid file is world readable --- diff --git a/src/tools.cc b/src/tools.cc index c3219a67d8..f274ad5344 100644 --- a/src/tools.cc +++ b/src/tools.cc @@ -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());