about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/text/ispell/patches/0024-Check-tempdir-creation.patch
blob: fd35ee34ec16858e1283d368b22a489a1d0580c4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
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
--