sysstat/sysstat-7.0.4-cve_2007_3852.patch

38 lines
1.2 KiB
Diff
Raw Normal View History

--- sysstat-7.0.4/sysstat.in.cve3852 2007-08-15 15:15:04.000000000 +0200
+++ sysstat-7.0.4/sysstat.in 2007-08-15 15:17:31.000000000 +0200
@@ -20,13 +20,11 @@
RETVAL=0
HISTORY=0
-TMPDIR=/var/run/
-# Remove flag indicating that sadc was successfully launched
-rm -f ${TMPDIR}sysstat.run
# See how we were called.
case "$1" in
start)
+ exitCodeIndicator="$(mktemp /tmp/sysstat-XXXXXX)" || exit 1
[ -r /etc/sysconfig/sysstat ] && . /etc/sysconfig/sysstat
if [ ${HISTORY} -gt 28 ]
then
@@ -43,15 +41,15 @@ case "$1" in
CHOWN ${CURRENTDIR} ${CURRENTFILE} ${CURRENTDIR}/${CURRENTFILE}
fi
echo -n "Calling the system activity data collector (sadc): "
- SU SA_LIB_DIR/sadc -F -L - && touch ${TMPDIR}sysstat.run QUOTE
+ SU SA_LIB_DIR/sadc -F -L - || rm -f ${exitCodeIndicator} QUOTE
# Try to guess if sadc was successfully launched. The difficulty
# here is that the exit code is lost when the above command is
# run via "su foo -c ..."
- if [ ! -f ${TMPDIR}sysstat.run ]; then
- RETVAL=1
+ if [ -f "${exitCodeIndicator}" ]; then
+ rm -f ${exitCodeIndicator}
else
- rm -f ${TMPDIR}sysstat.run
+ RETVAL=1
fi
echo
;;