From: Danny Smit Date: Mon, 8 Apr 2019 14:28:00 +0000 (+0200) Subject: #217: add umask sysconfig variable for sa1 and sa2 X-Git-Tag: v12.1.4~10^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4e11260ac292922b9483a1875a8100d36bb8b0f4;p=sysstat #217: add umask sysconfig variable for sa1 and sa2 --- diff --git a/sa1.in b/sa1.in index 6dca616..79ed60c 100644 --- a/sa1.in +++ b/sa1.in @@ -12,9 +12,12 @@ HISTORY=0 SADC_OPTIONS="" SA_DIR=@SA_DIR@ SYSCONFIG_DIR=@SYSCONFIG_DIR@ -umask 0022 +UMASK=0022 [ -r ${SYSCONFIG_DIR}/sysstat ] && . ${SYSCONFIG_DIR}/sysstat + +umask ${UMASK} + [ -d ${SA_DIR} ] || SA_DIR=@SA_DIR@ if [ ${HISTORY} -gt 28 ] diff --git a/sa2.in b/sa2.in index 4d48aea..cd4f71f 100644 --- a/sa2.in +++ b/sa2.in @@ -6,7 +6,6 @@ #@(#) sa2: Write a daily report # S_TIME_FORMAT=ISO ; export S_TIME_FORMAT -umask 0022 prefix=@prefix@ exec_prefix=@exec_prefix@ SA_DIR=@SA_DIR@ @@ -14,10 +13,13 @@ SYSCONFIG_DIR=@SYSCONFIG_DIR@ HISTORY=@HISTORY@ COMPRESSAFTER=@COMPRESSAFTER@ ZIP="@ZIP@" +UMASK=0022 # Read configuration file, overriding variables set above [ -r ${SYSCONFIG_DIR}/sysstat ] && . ${SYSCONFIG_DIR}/sysstat +umask ${UMASK} + [ -d ${SA_DIR} ] || SA_DIR=@SA_DIR@ # if YESTERDAY=no then today's summary is generated diff --git a/sysstat.sysconfig.in b/sysstat.sysconfig.in index 796da1f..69e4d17 100644 --- a/sysstat.sysconfig.in +++ b/sysstat.sysconfig.in @@ -26,3 +26,10 @@ ZIP="@ZIP@" # By default sa2 script generates reports files (the so called sarDD files). # Set this variable to false to disable reports generation. #REPORTS=false + +# The sa1 and sa2 scripts generate system activity data and report files in +# the @SA_DIR@ directory. By default the files are created with umask 0022 +# and are therefore readable for all users. Change this variable to restrict +# the permissions on the files (e.g. use 0027 to adhere to more strict +# security standards). +UMASK=0022