From ff15b58aca08d1d6d6dc344d38bd7077d9069770 Mon Sep 17 00:00:00 2001 From: Dan Langille Date: Wed, 10 Dec 2008 03:48:56 +0000 Subject: [PATCH] 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 --- bacula/examples/autochangers/mtx-changer.Adic-Scalar-24 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 ;; -- 2.39.5