From: Amos Jeffries Date: Tue, 4 Mar 2014 10:05:16 +0000 (-0700) Subject: Fix umask default on crash report generated email X-Git-Tag: SQUID_3_4_4~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e2ea8037f1632dcd37b7b9db1568fd24fb125db;p=thirdparty%2Fsquid.git Fix umask default on crash report generated email --- diff --git a/src/tools.cc b/src/tools.cc index a57af62dbc..076446ef42 100644 --- a/src/tools.cc +++ b/src/tools.cc @@ -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";