summaryrefslogtreecommitdiff
path: root/mail/metamail/patches/patch-ag
blob: b84492f149be5244a6ca6548c3ebf359f90c6196 (plain)
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
$NetBSD: patch-ag,v 1.3 2004/02/25 03:58:43 snj Exp $

diff -u -r mm2.7.org/src/bin/showaudio mm2.7/src/bin/showaudio
--- bin/showaudio	Wed Feb  2 16:21:26 1994
+++ bin/showaudio	Wed May 21 21:34:08 1997
@@ -15,9 +15,35 @@
 # WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
 #
 
-
+# Set a sensible value for the temporary directory, if its not
+# already set.  If TMPDIR is set previously, then we will
+# assume it is adequately protected.
 if (! $?METAMAIL_TMPDIR) then
-    set METAMAIL_TMPDIR=/tmp
+    if ($?TMPDIR) then
+        set METAMAIL_TMPDIR="$TMPDIR"
+    else
+        set METAMAIL_TMPDIR=~/metamail_tmp
+    endif
+endif
+
+# Set a sensible umask value
+umask 077
+
+# Make sure that the temporary directory is available
+if (! -d "$METAMAIL_TMPDIR") then
+
+    if (! -e "$METAMAIL_TMPDIR") then
+        mkdir "$METAMAIL_TMPDIR"
+    else
+        echo "$METAMAIL_TMPDIR exists, but is not a directory"
+        exit 2
+    endif
+
+    if ( $status != 0 || ! -d "$METAMAIL_TMPDIR" ) then
+        echo "Error creating $METAMAIL_TMPDIR"
+        exit 2
+    endif
+
 endif
 
 # First, figure out which machine to play it on!
@@ -33,7 +59,7 @@
 set ORG="Bellcore"
 set STDINPUT=0
 if ("$1" == "-p") then
-    set AUDIOPHONE=$2
+    set AUDIOPHONE="$2"
     shift
     shift
 endif
@@ -173,7 +199,7 @@
 	    set AUDIOPHONE=$<
 	endif
 	if ($thishost == $AUDIOPHONEHOST || $thishost == $AUDIOPHONEHOSTLONG) then
-	    echo Calling Phone number $AUDIOPHONE
+	    echo Calling Phone number "$AUDIOPHONE"
 	    echo "You MUST SAY HELLO when you answer the phone, or you will not hear the message."
 	    mail -s "showaudio: `whoami` called $AUDIOPHONE" $AUDIOLOGMAIL < /dev/null
 	    if ($STDINPUT) then
@@ -206,7 +232,7 @@
     echo -n "File name:"
     set fname=$<
 endif
-cp $1 $fname
+cp "$1" $fname
 if ($status == 0) echo Wrote raw audio file: $fname
 exit 0