[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bacula-devel] Debian Bacula vuln

>>> Easy fix - just use mktemp.
>> This is not really a "Bacula" problem because files in examples are
>> contributed code and not used or "supported" by the project.
> Well, OK, but it really IS an easy fix.  This is not tested, but  
> something like this should suffice:
> ...
> 	   loaded)
> 	       tempfile=`mktemp -t` || exit 33 # Or whatever nonzero exit  
> code is appropriate
> 	       ${MTX} -f $ctl status > $tempfile
> 	      rtn=$?
> 	      cat $tempfile | grep "^Data Transfer Element $drive:Full" | awk  
> '{print $7}'
> 	      cat $tempfile | grep "^Data Transfer Element $drive:Empty" |  
> awk '{print 0}'
> 	      rm -$tempfile
> 	      exit $rtn
> 	      ;;

Better solution:

    mtx_status="`${MTX} -f $ctl status`"
    echo "$mtx_status" | grep "^Data Transfer Element $drive:Full" \
    | awk  '{print $7}'
    echo "$mtx_status" | grep "^Data Transfer Element $drive:Empty"\
    | awk '{print 0}'
    exit $rtn

Tullio Andreatta

"L'intera campagna RIAA, fondata su trentamila cause, procede allo scopo
di condizionare l'opinione pubblica, affidandosi al principio secondo il
quale si può fare una inchiesta illegale condotta da investigatori senza
licenza e poi far seguire il tutto da una lettera di minacce."
                                                           -- Lory Lybeck

Disclaimer: "Please treat this email message in a reasonable way, or we
     might get angry" ( http://www.goldmark.org/jeff/stupid-disclaimers )

SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
Bacula-devel mailing list

This mailing list archive is a service of Copilotco.