From: Dan Langille Date: Wed, 10 Dec 2008 03:48:56 +0000 (+0000) Subject: Fix the temp file problem. X-Git-Tag: Release-3.0.0~506 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ff15b58aca08d1d6d6dc344d38bd7077d9069770;p=bacula%2Fbacula Fix the temp file problem. http://web.nvd.nist.gov/view/vuln/detail?execution=e4s1 http://lists.debian.org/debian-devel/2008/08/msg00347.html http://uvw.ru/report.sid.txt git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8134 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/examples/autochangers/mtx-changer.Adic-Scalar-24 b/bacula/examples/autochangers/mtx-changer.Adic-Scalar-24 index 9cdf6372f4..70a7409eee 100755 --- a/bacula/examples/autochangers/mtx-changer.Adic-Scalar-24 +++ b/bacula/examples/autochangers/mtx-changer.Adic-Scalar-24 @@ -102,11 +102,12 @@ case $cmd in ;; loaded) - ${MTX} -f $ctl status >/tmp/mtx.$$ + tempfile=`mktemp -t` || exit 33 + ${MTX} -f $ctl status > $tempfile rtn=$? - cat /tmp/mtx.$$ | grep "^Data Transfer Element $drive:Full" | awk '{print $7}' - cat /tmp/mtx.$$ | grep "^Data Transfer Element $drive:Empty" | awk '{print 0}' - rm -f /tmp/mtx.$$ + cat $tempfile | grep "^Data Transfer Element $drive:Full" | awk '{print $7}' + cat $tempfile | grep "^Data Transfer Element $drive:Empty" | awk '{print 0}' + rm -f $tempfile exit $rtn ;;