From: Michel B. <mi...@bo...> - 2005-02-15 06:58:05
|
Le Lundi 14 F=E9vrier 2005 23:40, Lionel Bouton a =E9crit : > > - update_sqlgrey_whitelists doesn't rely on mktemp's '-t' parameter > anymore. By the way, I find 2 issues in update_sqlgrey_whitelists : 1/ The result code or variable existence for mktemp is not tested : # Go into a temp directory MYTMP=3D`mktemp -dt sqlgrey.XXXXXX` cd $MYTMP I would prefer : # Go into a temp directory MYTMP=3D`mktemp -dt sqlgrey.XXXXXX` [ -n "$MYTMP" -a -d "$MYTMP" ] && cd $MYTMP || { echo "Error creating temporary directory; exit 1 } 2/ This frightens me (afraid of cd /; rm -rf * ;-) especially because of = (1)=20 above: # Setup a clean exit clean_exit() { cd / rm -rf $MYTMP exit $1 } I would very much prefer something like: # Setup a clean exit clean_exit() { cd ~sqlgrey [ -n "$MYTMP" -a -d "$MYTMP" ] && rm -rf $MYTMP exit $1 } --=20 Michel Bouissou <mi...@bo...> OpenPGP ID 0xDDE8AC6E |