]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix the temp file problem.
authorDan Langille <dan@langille.org>
Wed, 10 Dec 2008 03:48:56 +0000 (03:48 +0000)
committerDan Langille <dan@langille.org>
Wed, 10 Dec 2008 03:48:56 +0000 (03:48 +0000)
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

bacula/examples/autochangers/mtx-changer.Adic-Scalar-24

index 9cdf6372f4c016a42bf7d14390bc9ab35ef83856..70a7409eee2f1741b7df520565a45c0926abc1b6 100755 (executable)
@@ -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
       ;;