nixpkgs-suyu/pkgs/tools/text/ispell/patches/0024-Check-tempdir-creation.patch
2018-03-01 23:54:04 +01:00

69 lines
1.8 KiB
Diff

From: Robert Luberda <robert@debian.org>
Date: Tue, 8 Mar 2011 21:00:31 +0100
Subject: 0024 Check tempdir creation
Fail if temporary directory cannot be created.
---
findaffix.X | 3 ++-
munchlist.X | 3 ++-
subset.X | 3 ++-
zapdups.X | 3 ++-
4 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/findaffix.X b/findaffix.X
index 2c253e2..58cabab 100755
--- a/findaffix.X
+++ b/findaffix.X
@@ -179,7 +179,8 @@ TEMPDIR=`mktemp -d ${TDIR}/faffXXXXXXXXXX 2>/dev/null` || TEMPDIR="$TDIR"
TMP=${TEMPDIR}/faff$$
if [ "$TEMPDIR" = "$TDIR" ]
then
- TOREMOVE="${TMP}*"
+ echo "Failed to create temporary directory; exiting"
+ exit 1
else
TOREMOVE="$TEMPDIR"
fi
diff --git a/munchlist.X b/munchlist.X
index ada3f1d..47bb908 100755
--- a/munchlist.X
+++ b/munchlist.X
@@ -180,7 +180,8 @@ MUNCHDIR=`mktemp -d ${TDIR}/munchXXXXXXXXXX 2>/dev/null` || MUNCHDIR="$TDIR"
TMP=${MUNCHDIR}/munch$$
if [ "$MUNCHDIR" = "$TDIR" ]
then
- TOREMOVE="${TMP}*"
+ echo "$0: Failed to create temporary directory, exiting..."
+ exit 1
else
TOREMOVE="$MUNCHDIR"
fi
diff --git a/subset.X b/subset.X
index cc748ec..9c904cc 100755
--- a/subset.X
+++ b/subset.X
@@ -125,7 +125,8 @@ TEMPDIR=`mktemp -d ${TDIR}/ssetXXXXXXXXXX 2>/dev/null` || TEMPDIR="$TDIR"
TMP=${TEMPDIR}/sset$$
if [ "$TEMPDIR" = "$TDIR" ]
then
- TOREMOVE="${TMP}*"
+ echo "$0: Failed to create temporary directory, exiting..."
+ exit 1
else
TOREMOVE="$TEMPDIR"
fi
diff --git a/zapdups.X b/zapdups.X
index a68852a..1c610d4 100755
--- a/zapdups.X
+++ b/zapdups.X
@@ -111,7 +111,8 @@ TEMPDIR=`mktemp -d ${TDIR}/zapdXXXXXXXXXX 2>/dev/null` || TEMPDIR="$TDIR"
TMP=${TEMPDIR}/zapd$$
if [ "$TEMPDIR" = "$TDIR" ]
then
- TOREMOVE="${TMP}*"
+ echo "$0: Failed to create temporary directory, exiting..."
+ exit 1
else
TOREMOVE="$TEMPDIR"
fi
--