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
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
|
--- vfs/extfs/deb.in.orig Thu Dec 12 02:57:00 2002
+++ vfs/extfs/deb.in Tue Jun 15 03:15:09 2004
@@ -149,15 +149,10 @@
}
else
{
- $suffix = "aaa";
- while (1) {
- $tmpdir = "/tmp/mcdebfs.run".$$.$suffix;
- last if mkdir $tmpdir, 0700;
- $suffix++;
- # Somebody is being really nasty, give up
- exit 1 if $suffix eq "zzz";
- }
-
+ use File::Temp qw(mkdtemp);
+ my $template = "/tmp/mcdebfs.run.XXXXXX";
+ $template="$ENV{MC_TMPDIR}/mcdebfs.XXXXXX" if ($ENV{MC_TMPDIR});
+ $tmpdir = mkdtemp($template);
$tmpcmd="$tmpdir/run";
&mcdebfs_copyout($archive, $filename, $tmpcmd);
system("chmod u+x $tmpcmd");
--- vfs/extfs/rpm.orig Sun Dec 29 15:19:39 2002
+++ vfs/extfs/rpm Tue Jun 15 03:25:41 2004
@@ -1,14 +1,17 @@
#! /bin/sh
#
# Written by Erik Troan (ewt@redhat.com) 1996
-# Jakub Jelinek (jj@sunsite.mff.cuni.cz) 1996
+# Jakub Jelinek (jj@sunsite.mff.cuni.cz) 1996, 2004
# Tomasz K�oczko (kloczek@rudy.mif.pg.gda.pl) 1997
# minor changes by Wojtek Pilorz (wpilorz@bdk.lublin.pl) 1997
# minor changes by Michele Marziani (marziani@fe.infn.it) 1997
# bug files by Marc Merlin (marcsoft@merlins.org) 1998
# locale bugfix by Michal Svec (rebel@penguin.cz) 2000
-# (C) 1996 The Free Software Foundation.
+# Whitespace(s) & single quote(s) in filename workaround
+# by Andrew V. Samoilov <sav@bcs.zp.ua> 2004
+# https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=64007
#
+# (C) 1996-2004 The Free Software Foundation.
#
# override any locale for dates
@@ -22,6 +25,10 @@
RPM="rpm"
fi
RPM2CPIO="rpm2cpio"
+SED=sed
+# Surround the whole filename with single quotes and handle specially
+# \', ' and \ at the end of the string.
+SEDCMD="s/\\(\\\\\\?\\)'/'\\1\\1\\\\''/g;s/\\\\\$/'\\\\\\\\'/;s/^/'/;s/\$/'/"
mcrpmfs_list ()
{
@@ -31,12 +38,13 @@
if test -z "$MCFASTRPM"; then
MCFASTRPM=$MCFASTRPM_DFLT
fi
+ f="`echo "$1" | $SED "$SEDCMD"`"
FILEPREF="-r--r--r-- 1 root root "
- DESC=`$RPM -qip "$1" 2>/dev/null` || {
+ DESC=`$RPM -qip "$f" 2>/dev/null` || {
echo "$FILEPREF 0 "`date +"%b %d %H:%M"`" ERROR"
exit 1
}
- DATE=`$RPM -qp --qf "%{BUILDTIME:date}\n" "$1" | cut -c 5-11,21-24`
+ DATE=`$RPM -qp --qf "%{BUILDTIME:date}\n" "$f" | cut -c 5-11,21-24`
HEADERSIZE=`echo "$DESC" | wc -c`
echo "-r--r--r-- 1 root root $HEADERSIZE $DATE HEADER"
echo "-r-xr-xr-x 1 root root 39 $DATE INSTALL"
@@ -47,25 +55,25 @@
echo "$FILEPREF 0 $DATE INFO/BUILDHOST"
echo "$FILEPREF 0 $DATE INFO/SOURCERPM"
if test "$MCFASTRPM" = 0 ; then
- test "`$RPM -qp --qf \"%{DISTRIBUTION}\" \"$1\"`" = "(none)" ||
+ test "`$RPM -qp --qf \"%{DISTRIBUTION}\" \"$f\"`" = "(none)" ||
echo "$FILEPREF 0 $DATE INFO/DISTRIBUTION"
- test "`$RPM -qp --qf \"%{VENDOR}\" \"$1\"`" = "(none)" ||
+ test "`$RPM -qp --qf \"%{VENDOR}\" \"$f\"`" = "(none)" ||
echo "$FILEPREF 0 $DATE INFO/VENDOR"
- test "`$RPM -qp --qf \"%{DESCRIPTION}\" \"$1\"`" = "(none)" ||
+ test "`$RPM -qp --qf \"%{DESCRIPTION}\" \"$f\"`" = "(none)" ||
echo "$FILEPREF 0 $DATE INFO/DESCRIPTION"
- test "`$RPM -qp --qf \"%{SUMMARY}\" \"$1\"`" = "(none)" ||
+ test "`$RPM -qp --qf \"%{SUMMARY}\" \"$f\"`" = "(none)" ||
echo "$FILEPREF 0 $DATE INFO/SUMMARY"
- if test "`$RPM -qp --qf \"%{RPMTAG_PREIN}%{RPMTAG_POSTIN}%{RPMTAG_PREUN}%{RPMTAG_POSTUN}%{VERIFYSCRIPT}\" \"$1\"`" != "(none)(none)(none)(none)(none)"; then
+ if test "`$RPM -qp --qf \"%{RPMTAG_PREIN}%{RPMTAG_POSTIN}%{RPMTAG_PREUN}%{RPMTAG_POSTUN}%{VERIFYSCRIPT}\" \"$f\"`" != "(none)(none)(none)(none)(none)"; then
echo "dr-xr-xr-x 1 root root 0 $DATE INFO/SCRIPTS"
- test "`$RPM -qp --qf \"%{RPMTAG_PREIN}\" \"$1\"`" = '(none)' ||
+ test "`$RPM -qp --qf \"%{RPMTAG_PREIN}\" \"$f\"`" = '(none)' ||
echo "$FILEPREF 0 $DATE INFO/SCRIPTS/PREIN"
- test "`$RPM -qp --qf \"%{RPMTAG_POSTIN}\" \"$1\"`" = '(none)' ||
+ test "`$RPM -qp --qf \"%{RPMTAG_POSTIN}\" \"$f\"`" = '(none)' ||
echo "$FILEPREF 0 $DATE INFO/SCRIPTS/POSTIN"
- test "`$RPM -qp --qf \"%{RPMTAG_PREUN}\" \"$1\"`" = '(none)' ||
+ test "`$RPM -qp --qf \"%{RPMTAG_PREUN}\" \"$f\"`" = '(none)' ||
echo "$FILEPREF 0 $DATE INFO/SCRIPTS/PREUN"
- test "`$RPM -qp --qf \"%{RPMTAG_POSTUN}\" \"$1\"`" = '(none)' ||
+ test "`$RPM -qp --qf \"%{RPMTAG_POSTUN}\" \"$f\"`" = '(none)' ||
echo "$FILEPREF 0 $DATE INFO/SCRIPTS/POSTUN"
- test "`$RPM -qp --qf \"%{VERIFYSCRIPT}\" \"$1\"`" = '(none)' ||
+ test "`$RPM -qp --qf \"%{VERIFYSCRIPT}\" \"$f\"`" = '(none)' ||
echo "$FILEPREF 0 $DATE INFO/SCRIPTS/VERIFYSCRIPT"
echo "$FILEPREF 0 $DATE INFO/SCRIPTS/ALL"
fi
@@ -83,15 +91,15 @@
echo "$FILEPREF 0 $DATE INFO/SCRIPTS/ALL"
fi
if test "$MCFASTRPM" = 0 ; then
- test "`$RPM -qp --qf \"%{PACKAGER}\" \"$1\"`" = "(none)" ||
+ test "`$RPM -qp --qf \"%{PACKAGER}\" \"$f\"`" = "(none)" ||
echo "$FILEPREF 0 $DATE INFO/PACKAGER"
- test "`$RPM -qp --qf \"%{URL}\" \"$1\"`" = "(none)" ||
+ test "`$RPM -qp --qf \"%{URL}\" \"$f\"`" = "(none)" ||
echo "$FILEPREF 0 $DATE INFO/URL"
- test "`$RPM -qp --qf \"%{SERIAL}\" \"$1\"`" = "(none)" ||
+ test "`$RPM -qp --qf \"%{SERIAL}\" \"$f\"`" = "(none)" ||
echo "$FILEPREF 0 $DATE INFO/SERIAL"
- test "`$RPM -qp --qf \"%{COPYRIGHT}\" \"$1\"`" = "(none)" ||
+ test "`$RPM -qp --qf \"%{COPYRIGHT}\" \"$f\"`" = "(none)" ||
echo "$FILEPREF 0 $DATE INFO/COPYRIGHT"
- test "`$RPM -qp --qf \"%{LICENSE}\" \"$1\"`" = "(none)" ||
+ test "`$RPM -qp --qf \"%{LICENSE}\" \"$f\"`" = "(none)" ||
echo "$FILEPREF 0 $DATE INFO/LICENSE"
else
echo "$FILEPREF 0 $DATE INFO/PACKAGER"
@@ -105,13 +113,13 @@
echo "$FILEPREF 0 $DATE INFO/OS"
echo "$FILEPREF 0 $DATE INFO/SIZE"
if test "$MCFASTRPM" != 0 ; then
- $RPM -qp --qf "[%{REQUIRENAME}\n]" "$1" | grep "(none)" > /dev/null ||
+ $RPM -qp --qf "[%{REQUIRENAME}\n]" "$f" | grep "(none)" > /dev/null ||
echo "$FILEPREF 0 $DATE INFO/REQUIRENAME"
- $RPM -qp --qf "[%{OBSOLETES}\n]" "$1" | grep "(none)" > /dev/null ||
+ $RPM -qp --qf "[%{OBSOLETES}\n]" "$f" | grep "(none)" > /dev/null ||
echo "$FILEPREF 0 $DATE INFO/OBSOLETES"
- $RPM -qp --qf "[%{PROVIDES}\n]" "$1" | grep "(none)" > /dev/null ||
+ $RPM -qp --qf "[%{PROVIDES}\n]" "$f" | grep "(none)" > /dev/null ||
echo "$FILEPREF 0 $DATE INFO/PROVIDES"
- test "`$RPM -qp --qf \"%{CHANGELOGTEXT}\" \"$1\"`" = "(none)" ||
+ test "`$RPM -qp --qf \"%{CHANGELOGTEXT}\" \"$f\"`" = "(none)" ||
echo "$FILEPREF 0 $DATE INFO/CHANGELOG"
else
echo "$FILEPREF 0 $DATE INFO/REQUIRENAME"
@@ -120,61 +128,55 @@
echo "$FILEPREF 0 $DATE INFO/CHANGELOG"
fi
- $RPM2CPIO "$1" | cpio -tv --quiet
echo "$FILEPREF 0 $DATE CONTENTS.cpio"
}
mcrpmfs_copyout ()
{
+ f="`echo "$1" | $SED "$SEDCMD"`"
case "$2" in
- HEADER) $RPM -qip "$1" > "$3"; exit 0;;
+ HEADER) $RPM -qip "$f" > "$3"; exit 0;;
INSTALL) echo "# Run this to install this RPM package" > "$3"; exit 0;;
UPGRADE) echo "# Run this to upgrade this RPM package" > "$3"; exit 0;;
- ERROR) $RPM -qip "$1" > /dev/null 2> "$3"; exit 0;;
- INFO/NAME-VERSION-RELEASE) $RPM -qp --qf "%{NAME}-%{VERSION}-%{RELEASE}\n" "$1" > "$3"; exit 0;;
- INFO/RELEASE) $RPM -qp --qf "%{RELEASE}\n" "$1" > "$3"; exit 0;;
- INFO/GROUP) $RPM -qp --qf "%{GROUP}\n" "$1" > "$3"; exit 0;;
- INFO/DISTRIBUTION) $RPM -qp --qf "%{DISTRIBUTION}\n" "$1" > "$3"; exit 0;;
- INFO/VENDOR) $RPM -qp --qf "%{VENDOR}\n" "$1" > "$3"; exit 0;;
- INFO/BUILDHOST) $RPM -qp --qf "%{BUILDHOST}\n" "$1" > "$3"; exit 0;;
- INFO/SOURCERPM) $RPM -qp --qf "%{SOURCERPM}\n" "$1" > "$3"; exit 0;;
- INFO/DESCRIPTION) $RPM -qp --qf "%{DESCRIPTION}\n" "$1" > "$3"; exit 0;;
- INFO/PACKAGER) $RPM -qp --qf "%{PACKAGER}\n" "$1" > "$3"; exit 0;;
- INFO/URL) $RPM -qp --qf "%{URL}\n" "$1" >"$3"; exit 0;;
- INFO/BUILDTIME) $RPM -qp --qf "%{BUILDTIME:date}\n" "$1" >"$3"; exit 0;;
- INFO/SERIAL) $RPM -qp --qf "%{SERIAL}\n" "$1" >"$3"; exit 0;;
- INFO/COPYRIGHT) $RPM -qp --qf "%{COPYRIGHT}\n" "$1" >"$3"; exit 0;;
- INFO/RPMVERSION) $RPM -qp --qf "%{RPMVERSION}\n" "$1" >"$3"; exit 0;;
- INFO/REQUIRENAME) $RPM -qp --qf "[%{REQUIRENAME} %{REQUIREFLAGS:depflags} %{REQUIREVERSION}\n]" "$1" >"$3"; exit 0;;
- INFO/PROVIDES) $RPM -qp --qf "[%{PROVIDES}\n]" "$1" >"$3"; exit 0;;
- INFO/SCRIPTS/PREIN) $RPM -qp --qf "%{RPMTAG_PREIN}\n" "$1" >"$3"; exit 0;;
- INFO/SCRIPTS/POSTIN) $RPM -qp --qf "%{RPMTAG_POSTIN}\n" "$1" >"$3"; exit 0;;
- INFO/SCRIPTS/PREUN) $RPM -qp --qf "%{RPMTAG_PREUN}\n" "$1" >"$3"; exit 0;;
- INFO/SCRIPTS/POSTUN) $RPM -qp --qf "%{RPMTAG_POSTUN}\n" "$1" >"$3"; exit 0;;
- INFO/SCRIPTS/VERIFYSCRIPT) $RPM -qp --qf "%{VERIFYSCRIPT}\n" "$1" >"$3"; exit 0;;
- INFO/SCRIPTS/ALL) $RPM -qp --scripts "$1" > "$3"; exit 0;;
- INFO/SUMMARY) $RPM -qp --qf "%{SUMMARY}\n" "$1" > "$3"; exit 0;;
- INFO/OS) $RPM -qp --qf "%{OS}\n" "$1" > "$3"; exit 0;;
- INFO/CHANGELOG) $RPM -qp --qf "[* %{CHANGELOGTIME:date} %{CHANGELOGNAME}\n%{CHANGELOGTEXT}\n\n]\n" "$1" > "$3"; exit 0;;
- INFO/SIZE) $RPM -qp --qf "%{SIZE} bytes\n" "$1" > "$3"; exit 0;;
+ ERROR) $RPM -qip "$f" > /dev/null 2> "$3"; exit 0;;
+ INFO/NAME-VERSION-RELEASE) $RPM -qp --qf "%{NAME}-%{VERSION}-%{RELEASE}\n" "$f" > "$3"; exit 0;;
+ INFO/RELEASE) $RPM -qp --qf "%{RELEASE}\n" "$f" > "$3"; exit 0;;
+ INFO/GROUP) $RPM -qp --qf "%{GROUP}\n" "$f" > "$3"; exit 0;;
+ INFO/DISTRIBUTION) $RPM -qp --qf "%{DISTRIBUTION}\n" "$f" > "$3"; exit 0;;
+ INFO/VENDOR) $RPM -qp --qf "%{VENDOR}\n" "$f" > "$3"; exit 0;;
+ INFO/BUILDHOST) $RPM -qp --qf "%{BUILDHOST}\n" "$f" > "$3"; exit 0;;
+ INFO/SOURCERPM) $RPM -qp --qf "%{SOURCERPM}\n" "$f" > "$3"; exit 0;;
+ INFO/DESCRIPTION) $RPM -qp --qf "%{DESCRIPTION}\n" "$f" > "$3"; exit 0;;
+ INFO/PACKAGER) $RPM -qp --qf "%{PACKAGER}\n" "$f" > "$3"; exit 0;;
+ INFO/URL) $RPM -qp --qf "%{URL}\n" "$f" >"$3"; exit 0;;
+ INFO/BUILDTIME) $RPM -qp --qf "%{BUILDTIME:date}\n" "$f" >"$3"; exit 0;;
+ INFO/SERIAL) $RPM -qp --qf "%{SERIAL}\n" "$f" >"$3"; exit 0;;
+ INFO/COPYRIGHT) $RPM -qp --qf "%{COPYRIGHT}\n" "$f" >"$3"; exit 0;;
+ INFO/RPMVERSION) $RPM -qp --qf "%{RPMVERSION}\n" "$f" >"$3"; exit 0;;
+ INFO/REQUIRENAME) $RPM -qp --qf "[%{REQUIRENAME} %{REQUIREFLAGS:depflags} %{REQUIREVERSION}\n]" "$f" >"$3"; exit 0;;
+ INFO/PROVIDES) $RPM -qp --qf "[%{PROVIDES}\n]" "$f" >"$3"; exit 0;;
+ INFO/SCRIPTS/PREIN) $RPM -qp --qf "%{RPMTAG_PREIN}\n" "$f" >"$3"; exit 0;;
+ INFO/SCRIPTS/POSTIN) $RPM -qp --qf "%{RPMTAG_POSTIN}\n" "$f" >"$3"; exit 0;;
+ INFO/SCRIPTS/PREUN) $RPM -qp --qf "%{RPMTAG_PREUN}\n" "$f" >"$3"; exit 0;;
+ INFO/SCRIPTS/POSTUN) $RPM -qp --qf "%{RPMTAG_POSTUN}\n" "$f" >"$3"; exit 0;;
+ INFO/SCRIPTS/VERIFYSCRIPT) $RPM -qp --qf "%{VERIFYSCRIPT}\n" "$f" >"$3"; exit 0;;
+ INFO/SCRIPTS/ALL) $RPM -qp --scripts "$f" > "$3"; exit 0;;
+ INFO/SUMMARY) $RPM -qp --qf "%{SUMMARY}\n" "$f" > "$3"; exit 0;;
+ INFO/OS) $RPM -qp --qf "%{OS}\n" "$f" > "$3"; exit 0;;
+ INFO/CHANGELOG) $RPM -qp --qf "[* %{CHANGELOGTIME:date} %{CHANGELOGNAME}\n%{CHANGELOGTEXT}\n\n]\n" "$f" > "$3"; exit 0;;
+ INFO/SIZE) $RPM -qp --qf "%{SIZE} bytes\n" "$f" > "$3"; exit 0;;
CONTENTS.cpio) $RPM2CPIO "$1" > "$3"; exit 0;;
*)
- TMPDIR=/tmp/mctmpdir.$$
- mkdir $TMPDIR || exit 1
- cd $TMPDIR
- # Files in RPM version 4 and above start with "./" - try both
- $RPM2CPIO "$1" | cpio -iumd --quiet "$2" "./$2" >/dev/null
- mv "$2" "$3" 2>/dev/null
- cd /
- rm -rf $TMPDIR;;
+ ;;
esac
}
mcrpmfs_run ()
{
+ f="`echo "$1" | $SED "$SEDCMD"`"
case "$2" in
- INSTALL) echo "Installing \"$1\""; $RPM -ivh "$1"; exit 0;;
- UPGRADE) echo "Upgrading \"$1\""; $RPM -iUvh "$1"; exit 0;;
+ INSTALL) echo "Installing \"$1\""; $RPM -ivh "$f"; exit 0;;
+ UPGRADE) echo "Upgrading \"$1\""; $RPM -Uvh "$f"; exit 0;;
esac
}
--- vfs/extfs/uar.in.orig Thu Dec 12 15:21:35 2002
+++ vfs/extfs/uar.in Tue Jun 15 03:15:09 2004
@@ -22,8 +22,7 @@
mcarfs_copyin ()
{
- TMPDIR=/tmp/mctmpdir-uar.$$
- mkdir $TMPDIR || exit 1
+ TMPDIR=`mktemp -d ${MC_TMPDIR:-/tmp}/mctmpdir-uar.XXXXXX` || exit 1
name=`basename "$2"`
(cd $TMPDIR && cp -fp "$3" $name && $XAR r "$1" $name)
rm -rf $TMPDIR
--- vfs/extfs/uha.in.orig Sat Dec 14 11:10:53 2002
+++ vfs/extfs/uha.in Tue Jun 15 03:15:09 2004
@@ -31,8 +31,7 @@
mchafs_copyout ()
{
- TMPDIR="/tmp/mctmpdir-uha.$$"
- mkdir $TMPDIR || exit 1
+ TMPDIR=`mktemp -d ${MC_TMPDIR:-/tmp}/mctmpdir-uha.XXXXXX` || exit 1
cd $TMPDIR
$HA xyq "$1" "$2" >/dev/null
--- vfs/extfs/ulha.in.orig Sat Dec 14 10:39:10 2002
+++ vfs/extfs/ulha.in Tue Jun 15 03:15:09 2004
@@ -35,12 +35,6 @@
LHA_GET="lha pq"
LHA_PUT="lha aq"
-# Define a directory to create a temporary file for when
-# running a command to be run from the archive
-TMPDIR="/tmp/mctmpdir-uha.$$"
-# Temporary file within the directory
-TMPCMD=$TMPDIR/run
-
# The 'list' command executive
mc_lha_fs_list()
@@ -121,9 +115,9 @@
mc_lha_fs_run()
{
+ TMPDIR=`mktemp -d ${MC_TMPDIR:-/tmp}/mctmpdir-ulha.XXXXXX` || exit 1
trap "rm -rf $TMPDIR; exit 0" 1 2 3 4 15
- # FIXME: Try harder to generate a unique directory if this fails
- mkdir -m 0700 $TMPDIR || exit 1
+ TMPCMD=$TMPDIR/run
$LHA_GET "$1" "$2" > $TMPCMD
chmod a+x $TMPCMD
$TMPCMD
--- vfs/extfs/urar.in.orig Fri Jan 24 21:56:25 2003
+++ vfs/extfs/urar.in Tue Jun 15 03:15:09 2004
@@ -77,8 +77,7 @@
# preserve pwd. It is clean, but is it necessary?
pwd=`pwd`
# Create a directory and create in it a tmp directory with the good name
- dir=tmpdir.${RANDOM}
- mkdir $dir
+ dir=`mktemp -d ${MC_TMPDIR:-/tmp}/mctmpdir-urar.XXXXXX` || exit 1
cd $dir
mkdir -p "$2"
# rar cannot create an empty directory
--- vfs/extfs/uzip.in.orig Thu Dec 12 15:15:20 2002
+++ vfs/extfs/uzip.in Tue Jun 15 03:18:53 2004
@@ -76,7 +76,7 @@
sub mczipfs_rmdir {
my ($qfile) = map { &zipquotemeta($_) } @_;
&checkargs(1, 'archive directory', @_);
- &safesystem("$cmd_delete $qarchive $qfile/ >/dev/null", 12);
+ &safesystem("$cmd_delete $qarchive $qfile/ >/dev/null 2>&1", 12);
exit;
}
@@ -87,7 +87,7 @@
my ($qafile, $qfsfile) = map { &zipquotemeta($_) } @_;
&checkargs(1, 'archive file', @_);
&checkargs(2, 'local file', @_);
- &safesystem("$cmd_extract $qarchive $qafile > $qfsfile", 11);
+ &safesystem("$cmd_extract $qarchive $qafile > $qfsfile 2>/dev/null", 11);
exit;
}
@@ -344,10 +344,10 @@
# Make a temporary directory with mode 0700.
sub mktmpdir {
- while (1) {
- my $dir = POSIX::tmpnam();
- return $dir if mkdir ($dir, 0700);
- }
+ use File::Temp qw(mkdtemp);
+ my $template = "/tmp/mcuzipfs.XXXXXX";
+ $template="$ENV{MC_TMPDIR}/mcuzipfs.XXXXXX" if ($ENV{MC_TMPDIR});
+ return mkdtemp($template);
}
# Make a filename absolute and return it.
--- vfs/extfs/uzoo.in.orig Sat Dec 14 10:29:13 2002
+++ vfs/extfs/uzoo.in Tue Jun 15 03:15:09 2004
@@ -13,8 +13,7 @@
# it to a temporary directory.
mklink ()
{
- TMPDIR="/tmp/mctmpdir-uzoo.$$"
- mkdir $TMPDIR || exit 1
+ TMPDIR=`mktemp -d ${MC_TMPDIR:-/tmp}/mctmpdir-uzoo.XXXXXX` || exit 1
trap 'cd /; rm -rf $TMPDIR' 0 1 2 3 5 13 15
ARCHIVE=$TMPDIR/tmp.zoo
ln -sf "$1" "$ARCHIVE"
|