Re: Fix for password-protected .rar files
- From: Denis Vlasenko <vda linux googlemail com>
- To: Pavel Tsekov <ptsekov gmx net>, MC dev <mc-devel gnome org>
- Subject: Re: Fix for password-protected .rar files
- Date: Tue, 25 Jul 2006 15:36:26 +0200
On Tuesday 25 July 2006 09:44, Pavel Tsekov wrote:
> Hello Denis,
>
> On Mon, 24 Jul 2006, Denis Vlasenko wrote:
>
> >> The patch includes random quoting of shell variables as well
> >> as formatting fixes - please submit a proper patch which does
> >> only what it advertises.
> >
> > Ok, the attached patch quotes some environment variables.
> >
> > vfs/extfs/* scripts seem to presume that there are no spaces
> > in filenames. Yes, we typically do not expect $TMPDIR to contain spaces,
> > but if it will contain them on some strange system, then what?
> > Is cd $TMPDIR ok? No! cd "$TMPDIR"!
> >
> > The attached patch fixes these.
>
> The attached patch again includes indentation-only fixes (rpm, trpm, uar,
> maybe others). Please, submit a proper patch.
Patch is fixed and split up into quoting fixes and indent fixes.
See attached.
Please apply.
--
vda
diff -urpN mc-4.6.1.org/vfs/extfs/audio.in mc-4.6.1.extfs/vfs/extfs/audio.in
--- mc-4.6.1.org/vfs/extfs/audio.in 2004-11-10 17:08:00.000000000 +0100
+++ mc-4.6.1.extfs/vfs/extfs/audio.in 2006-07-25 14:48:18.000000000 +0200
@@ -19,7 +19,7 @@ audiofs_list()
cdparanoia -Q -d "$1" 2>&1 | grep '^[ 0-9][ 0-9][ 0-9]\.' | while read A B C
do
A=`echo "$A" | sed -e 's/\.//' -e 's/^\(.\)$/0\1/'`
- SIZE=`expr 44 + $B \* 2352`
+ SIZE=`expr 44 + "$B" \* 2352`
echo "-r--r--r-- 1 0 0 $SIZE $DATE track-${A}.wav"
done
}
@@ -35,7 +35,7 @@ audiofs_copyout()
wget -q -T $CDDB_TIMEOUT -O - "$CDDB_SERVER/~cddb/cddb.cgi?cmd=cddb+read+$RESPONSE&$CDDB_HANDSHAKE" | grep -v "^#" >> "$3"
else
TRACK=`echo "$2" | sed 's/track-0*//' | sed 's/\.wav//'`
- cdparanoia -q -d "$1" $TRACK "$3" >/dev/null
+ cdparanoia -q -d "$1" "$TRACK" "$3" >/dev/null
fi
}
diff -urpN mc-4.6.1.org/vfs/extfs/bpp mc-4.6.1.extfs/vfs/extfs/bpp
--- mc-4.6.1.org/vfs/extfs/bpp 2002-12-09 06:01:04.000000000 +0100
+++ mc-4.6.1.extfs/vfs/extfs/bpp 2006-07-25 14:48:18.000000000 +0200
@@ -17,7 +17,7 @@ mcbppfs_list ()
FILEPREF="-r--r--r-- 1 root root "
FIEXPREF="-r-xr-xr-x 1 root root "
DATE=`date +"%b %d %H:%M"`
- set x `ls -l $1`
+ set x `ls -l "$1"`
size=$6
echo "$FILEPREF $size $DATE CONTENTS.tar.gz"
echo "$FIEXPREF 35 $DATE INSTALL"
diff -urpN mc-4.6.1.org/vfs/extfs/iso9660.in mc-4.6.1.extfs/vfs/extfs/iso9660.in
--- mc-4.6.1.org/vfs/extfs/iso9660.in 2004-10-29 11:14:38.000000000 +0200
+++ mc-4.6.1.extfs/vfs/extfs/iso9660.in 2006-07-25 14:48:18.000000000 +0200
@@ -11,7 +11,7 @@
test_iso () {
CHARSET=`echo "$save_ctype" | sed -n -e 's/.*\.\(.*\)"$/\1/p' | tr '[A-Z]' '[a-z]'`
if test -n "$CHARSET"; then
- isoinfo -j $CHARSET 2>&1 | grep "Unknown charset" >/dev/null && CHARSET=
+ isoinfo -j "$CHARSET" 2>&1 | grep "Unknown charset" >/dev/null && CHARSET=
fi
if test -n "$CHARSET"; then
JOLIET_OPT="-j $CHARSET -J"
diff -urpN mc-4.6.1.org/vfs/extfs/uzoo.in mc-4.6.1.extfs/vfs/extfs/uzoo.in
--- mc-4.6.1.org/vfs/extfs/uzoo.in 2004-08-17 10:24:59.000000000 +0200
+++ mc-4.6.1.extfs/vfs/extfs/uzoo.in 2006-07-25 14:48:18.000000000 +0200
@@ -14,10 +14,10 @@ ZOO=zoo
mklink ()
{
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
+ trap 'cd /; rm -rf "$TMPDIR"' 0 1 2 3 5 13 15
+ ARCHIVE="$TMPDIR/tmp.zoo"
ln -sf "$1" "$ARCHIVE"
- cd $TMPDIR || exit 1
+ cd "$TMPDIR" || exit 1
}
mczoofs_list ()
diff -urpN mc-4.6.1.extfs/vfs/extfs/iso9660.in mc-4.6.1.indent/vfs/extfs/iso9660.in
--- mc-4.6.1.extfs/vfs/extfs/iso9660.in 2006-07-25 14:48:18.000000000 +0200
+++ mc-4.6.1.indent/vfs/extfs/iso9660.in 2006-07-25 14:49:18.000000000 +0200
@@ -62,7 +62,7 @@ BEGIN {
}
mcisofs_copyout () {
- $ISOINFO -i "$1" -x "/$2" > "$3"
+ $ISOINFO -i "$1" -x "/$2" > "$3"
}
save_ctype=`locale | grep LC_CTYPE`
diff -urpN mc-4.6.1.extfs/vfs/extfs/rpm mc-4.6.1.indent/vfs/extfs/rpm
--- mc-4.6.1.extfs/vfs/extfs/rpm 2004-09-03 23:23:05.000000000 +0200
+++ mc-4.6.1.indent/vfs/extfs/rpm 2006-07-25 14:49:18.000000000 +0200
@@ -20,9 +20,9 @@ LC_TIME=C
export LC_TIME
if rpm --nosignature --version >/dev/null 2>&1; then
- RPM="rpm --nosignature"
+ RPM="rpm --nosignature"
else
- RPM="rpm"
+ RPM="rpm"
fi
RPM2CPIO="rpm2cpio"
SED="sed"
diff -urpN mc-4.6.1.extfs/vfs/extfs/trpm mc-4.6.1.indent/vfs/extfs/trpm
--- mc-4.6.1.extfs/vfs/extfs/trpm 2004-10-27 16:44:31.000000000 +0200
+++ mc-4.6.1.indent/vfs/extfs/trpm 2006-07-25 14:49:18.000000000 +0200
@@ -20,9 +20,9 @@ LC_TIME=C
export LC_TIME
if rpm --nosignature --version >/dev/null 2>&1; then
- RPM="rpm --nosignature"
+ RPM="rpm --nosignature"
else
- RPM="rpm"
+ RPM="rpm"
fi
mcrpmfs_list ()
diff -urpN mc-4.6.1.extfs/vfs/extfs/uar.in mc-4.6.1.indent/vfs/extfs/uar.in
--- mc-4.6.1.extfs/vfs/extfs/uar.in 2004-11-10 17:08:00.000000000 +0100
+++ mc-4.6.1.indent/vfs/extfs/uar.in 2006-07-25 14:49:18.000000000 +0200
@@ -12,7 +12,7 @@ XAR=ar
mcarfs_list ()
{
- $XAR tv "$1" | sed 's,^,-,;s, , 1 ,;s,/, ,'
+ $XAR tv "$1" | sed 's,^,-,;s, , 1 ,;s,/, ,'
}
mcarfs_copyout ()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]