From: Amos Jeffries Date: Sun, 9 Mar 2014 02:12:14 +0000 (-0700) Subject: Fix umask default on crash report generated email X-Git-Tag: SQUID_3_3_12~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a35ced5ed7aa569727e80c54cd49c4b0c19e7105;p=thirdparty%2Fsquid.git Fix umask default on crash report generated email --- diff --git a/src/tools.cc b/src/tools.cc index f235b9f89d..fecdb400b0 100644 --- a/src/tools.cc +++ b/src/tools.cc @@ -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";