]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix umask default on crash report generated email
authorAmos Jeffries <squid3@treenet.co.nz>
Sun, 9 Mar 2014 02:12:14 +0000 (19:12 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 9 Mar 2014 02:12:14 +0000 (19:12 -0700)
src/tools.cc

index f235b9f89dbfb773d07fd772468b7da3d7cf098a..fecdb400b061937e7a4aa650b9173f5c73bc49ed 100644 (file)
@@ -128,7 +128,14 @@ mail_warranty(void)
     FILE *fp = NULL;
     static char command[256];
 
-    const mode_t prev_umask=umask(S_IRWXU);
+    /*
+     * NP: umask() takes the mask of bits we DONT want set.
+     *
+     * We want the current user to have read/write access
+     * and since this file will be passed to mailsystem,
+     * the group and other must have read access.
+     */
+    const mode_t prev_umask=umask(S_IXUSR|S_IXGRP|S_IWGRP|S_IWOTH|S_IXOTH);
 
 #if HAVE_MKSTEMP
     char filename[] = "/tmp/squid-XXXXXX";