diff --git a/filters/application/msword_filter b/filters/application/msword_filter index ef9bb4c..95d73da 100755 --- a/filters/application/msword_filter +++ b/filters/application/msword_filter @@ -1,17 +1,14 @@ #!/bin/sh -tmpdir=${TMPDIR-/tmp} -tmpdir="$tmpdir"/tmpdir.$$ +tmpdir=`mktemp -td tracker.msword_filter.XXXXXXXXXX` || exit 1 -tmptxtfile=`mktemp` +tmptxtfile=`mktemp` || exit 1 -(umask 077 && mkdir "$tmpdir") || exit 1 - -tmpfile="$tmpdir"/tmpfile.$$ +tmpfile="$tmpdir"/tmpfile cp "$1" "$tmpfile" -# Change the working directory to $tmpdir which we can safely deleter later. +# Change the working directory to $tmpdir which we can safely delete later. # Some distributions ship a version of wvText which extracts the image files # from the word document and places them in the current working directory. @@ -19,6 +16,8 @@ cd "$tmpdir" nice -n19 wvText "$tmpfile" "$tmptxtfile" +cat "$tmptxtfile" + rm -rf "$tmpdir" rm "$tmptxtfile"