]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix umask default on crash report generated email
authorAmos Jeffries <squid3@treenet.co.nz>
Tue, 18 Feb 2014 11:39:58 +0000 (04:39 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 18 Feb 2014 11:39:58 +0000 (04:39 -0700)
src/tools.cc

index d4b75da3d3116dd80d3571deed13395367846fbe..5f9ec9b86a9c9f3eef2033978c73f9c8ebedc414 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";