From: Amos Jeffries Date: Tue, 18 Feb 2014 11:39:58 +0000 (-0700) Subject: Fix umask default on crash report generated email X-Git-Tag: SQUID_3_5_0_1~363 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a2c13db1fecdcc9e5f237556fa3057dbc23878c2;p=thirdparty%2Fsquid.git Fix umask default on crash report generated email --- diff --git a/src/tools.cc b/src/tools.cc index d4b75da3d3..5f9ec9b86a 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";