[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:

  loaded)
    mtx_status="`${MTX} -f $ctl status`"
    rtn=$?
    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
09:f9:11:02:9d:74:e3:5b:d8:41:56:c5:63:56:88:c0
45:5f:e1:04:22:ca:29:c4:93:3f:95:05:2b:79:2a:b2

"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
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Bacula-devel mailing list
Bacula-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/bacula-devel


This mailing list archive is a service of Copilotco.