diff -Naur a/etc/shtool b/etc/shtool --- a/etc/shtool 2005-08-17 14:21:24.000000000 +0200 +++ b/etc/shtool 2005-08-17 14:25:01.000000000 +0200 @@ -378,8 +378,14 @@ tmpdir="$TEMPDIR" fi fi - tmpfile="$tmpdir/.shtool.$$" - rm -f $tmpfile >/dev/null 2>&1 + if mkdir "$tmpdir/.shtool.$$"; then + tmpfile="$tmpdir/.shtool.$$/shtool.tmp" + else + echo "$msgprefix:Error: failed to create temporary file" 1>&2 + exit 1 + fi + tmpfile="$tmpdir/.shtool.$$/shtool.tmp" + rm -fr "$tmpdir/.shtool.$$" >/dev/null 2>&1 || true touch $tmpfile fi