If HISTORY is greater than 28, the sa1 script does not execute the
command "umask 0022" until after the new output file is created,
allowing it to have the wrong permissions if the root umask is not set
to 0022. So move the umask command above that "if" statement.
Reported-by: Peter Schiffer <pschiffe@redhat.com.fake>
Signed-off-by: Sebastien GODARD <sysstat@orange.fr.fake>
CURRENTFILE=sa${DATE}
CURRENTDIR=`date +%Y%m`
SYSCONFIG_DIR=@SYSCONFIG_DIR@
+umask 0022
[ -r ${SYSCONFIG_DIR}/sysstat ] && . ${SYSCONFIG_DIR}/sysstat
if [ ${HISTORY} -gt 28 ]
# month then delete it so that it is recreated by sadc afresh
[ -f ${CURRENTFILE} ] && [ "`date +%Y%m -r ${CURRENTFILE}`" -lt "${CURRENTDIR}" ] && rm -f ${CURRENTFILE}
fi
-umask 0022
+
ENDIR=@SA_LIB_DIR@
cd ${ENDIR}
[ "$1" = "--boot" ] && shift && BOOT=y || BOOT=n