summaryrefslogtreecommitdiff
path: root/mail/metamail/patches/patch-ag
blob: 1c10eaedcaee3d03d720358f65f2bc6a50856f68 (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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
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
 
Only in mm2.7/src/bin: showaudio~
diff -u -r mm2.7.org/src/bin/showexternal mm2.7/src/bin/showexternal
--- bin/showexternal	Tue Feb  8 09:39:05 1994
+++ bin/showexternal	Wed May 21 21:41:39 1997
@@ -15,9 +15,45 @@
 # WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
 # 
 
+# Check argument integrity. Don't trust mail headers
+switch ("$1$2$3$4$5$6$7")
+case "*[\t ]*":
+  echo "Illegal white space in arguments\!"
+  echo "Command was:"
+  echo "'$0' '$1' '$2' '$3' '$4' '$5' '$6' '$7'"
+  exit 2
+endsw
+
 onintr cleanup
+# 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
 if (! $?FTP) then
     set FTP=ftp
Only in mm2.7/src/bin: showexternal~
diff -u -r mm2.7.org/src/bin/showpartial mm2.7/src/bin/showpartial
--- bin/showpartial	Wed Feb  2 16:21:29 1994
+++ bin/showpartial	Wed May 21 21:39:49 1997
@@ -2,8 +2,44 @@
 # (The "-fb" might need to be changed to "-f" on some systems)
 #
 
+# Check argument integrity. Don't trust mail headers
+switch ("$1$2$3$4")
+case "*[\t ]*":
+  echo "Illegal white space in arguments\!"
+  echo "Command was:"
+  echo "'$0' '$1' '$2' '$3' '$4'"
+  exit 2
+endsw
+
+# 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
 
 set TREEROOT=${METAMAIL_TMPDIR}/m-prts-`whoami`
@@ -11,14 +47,14 @@
     echo "Usage:  showpartial file id partnum totalnum"
     exit -1
 endif
-set file=$1
+set file="$1"
 # This next line is because message-id can contain weird chars
-set id=`echo $2 | tr -d  \!\$\&\*\(\)\|\'\"\;\/\<\>\\` 
-@ partnum = $3
-if ($#argv == 3 || $4 == "") then
+set id=`echo "$2" | tr -d  \!\$\&\*\(\)\|\'\"\;\/\<\>\\` 
+@ partnum = "$3"
+if ($#argv == 3 || "$4" == "") then
     set totalnum=-1
 else
-    @ totalnum = $4
+    @ totalnum = "$4"
 endif
 
 if (! -d  $TREEROOT)  then
@@ -35,9 +71,9 @@
         exit -1
     endif
 endif
-cp $file ${TREEROOT}/$id/$partnum
+cp "$file" ${TREEROOT}/$id/$partnum
 if ($status) then 
-    echo cp $file ${TREEROOT}/$id/$partnum failed
+    echo cp "$file" ${TREEROOT}/$id/$partnum failed
     exit -1
 endif
 if ($totalnum == -1) then
Only in mm2.7/src/bin: showpartial~
diff -u -r mm2.7.org/src/bin/showpicture mm2.7/src/bin/showpicture
--- bin/showpicture	Mon Feb  7 10:59:54 1994
+++ bin/showpicture	Wed May 21 21:34:59 1997
@@ -15,15 +15,42 @@
 # 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
 
 if (! $?X_VIEWER) then
-set X_VIEWER="xloadimage -view -quiet -geometry +1+1"
+  set X_VIEWER="xloadimage -view -quiet -geometry +1+1"
 # set X_VIEWER="xv -geometry +1+1"
 endif
-if ($1 == "-viewer" && $#argv > 1) then
+if ("$1" == "-viewer" && $#argv > 1) then
     set X_VIEWER = "$2"
     shift
     shift
@@ -57,7 +84,7 @@
             endif
         end
     endif
-    cp $1 $fname
+    cp "$1" $fname
     if ($status == 0) echo Wrote file $fname
     exit 0
 endif