]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
fts: Added a bit more error checking to decode2text.sh
authorTimo Sirainen <tss@iki.fi>
Thu, 4 Aug 2011 11:49:36 +0000 (14:49 +0300)
committerTimo Sirainen <tss@iki.fi>
Thu, 4 Aug 2011 11:49:36 +0000 (14:49 +0300)
src/plugins/fts/decode2text.sh

index c62c7b635f9bc6eccf5b61c8a250ffccb4e81ccb..77761f77b8a8904bf6364682203dcec6433c73f5 100755 (executable)
@@ -59,8 +59,11 @@ xmlunzip() {
   name=$1
 
   tempdir=`mktemp -d`
+  if [ "$tempdir" = "" ]; then 
+    exit 1
+  fi
   trap "rm -rf $tempdir" 0 1 2 3 15
-  cd $tempdir
+  cd $tempdir || exit 1
   unzip -q "$path"
   find . -name "$name" -print0 | xargs -0 cat |
     /usr/local/libexec/dovecot/xml2text