]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix umask default on crash report generated email
authorAmos Jeffries <squid3@treenet.co.nz>
Tue, 4 Mar 2014 10:05:16 +0000 (03:05 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 4 Mar 2014 10:05:16 +0000 (03:05 -0700)
src/tools.cc

index a57af62dbc9f8993b16123e87f9d1965758d4a91..076446ef428d30f4950cae2059b4e1b51fc19e2c 100644 (file)
@@ -131,7 +131,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";