extfs shell script fixes (hp48.in)
- From: Leonard den Ottolander <leonard den ottolander nl>
- To: MC Devel <mc-devel gnome org>
- Cc: Vladimir Nadvornik <nadvornik suse cz>
- Subject: extfs shell script fixes (hp48.in)
- Date: Thu, 14 Oct 2004 15:21:11 +0200
Hi,
Some remarks on the SUSE extfs shell fixes regarding hp48.in:
Instead of using the CHECK loop it is probably just as easy to just
quote the parameters that are being fed to spawned shells. See the
attached patch (I don't distinguish between trusted and untrusted
parameters, but just quote everything).
Leonard.
--
mount -t life -o ro /dev/dna /genetic/research
--- hp48.in.000 2002-12-14 03:46:05.000000000 +0100
+++ hp48.in 2004-10-14 15:16:58.000000000 +0200
@@ -32,7 +32,7 @@ $KERMIT -C "SET EXIT WARNING OFF,REMOTE
hp48_cd()
{
(echo SET EXIT WARNING OFF;echo REMOTE HOST HOME
-for HP48_DIR in `echo $*|tr '/' ' '`;do
+for HP48_DIR in `echo "$*" | tr '/' ' '`;do
if [ "$HP48_DIR" != "." ];then echo REMOTE HOST $HP48_DIR;fi
done
echo QUIT)| $KERMIT -B >/dev/null
@@ -54,10 +54,10 @@ HP48_DIRS=
read INPUT
while [ "$INPUT" != "EOF" ]
do
- case `echo $INPUT | $AWK '{if (int($2)) if ($3=="Directory") print "dir";else print "file"}'` in
- dir) HP48_DIRS="$HP48_DIRS `hp48_retdir $INPUT`"
- printf "drwxr-xr-x 1 %-8d %-8d %8d %s %s\n" 0 0 `hp48_retsize $INPUT` "`date +\"%b %d %Y %k:%M"`" "$HP48_CDIR/`hp48_retdir $INPUT`";;
- file) printf "-rw-r--r-- 1 %-8d %-8d %8d %s %s\n" 0 0 `hp48_retsize $INPUT` "`date +"%b %d %Y %k:%M"`" "$HP48_CDIR/`hp48_retdir $INPUT`";;
+ case `echo "$INPUT" | $AWK '{if (int($2)) if ($3 == "Directory") print "dir";else print "file"}'` in
+ dir) HP48_DIRS="$HP48_DIRS `hp48_retdir \"$INPUT\"`"
+ printf "drwxr-xr-x 1 %-8d %-8d %8d %s %s\n" 0 0 `hp48_retsize "$INPUT"` "`date +\"%b %d %Y %k:%M\"`" "$HP48_CDIR/`hp48_retdir \"$INPUT\"`";;
+ file) printf "-rw-r--r-- 1 %-8d %-8d %8d %s %s\n" 0 0 `hp48_retsize "$INPUT"` "`date +\"%b %d %Y %k:%M\"`" "$HP48_CDIR/`hp48_retdir \"$INPUT\"`";;
esac
read INPUT
done
@@ -84,14 +84,14 @@ list) HP48_CDIR=
hp48_list
exit 0;;
copyout)
- cd `dirname $4`
- hp48_cd `dirname $3`
- $KERMIT -B -g `basename $3` -a $4 >/dev/null
+ cd `dirname "$4"`
+ hp48_cd `dirname "$3"`
+ $KERMIT -B -g `basename "$3"` -a $4 >/dev/null
exit 0;;
copyin)
- cd `dirname $4`
- hp48_cd `dirname $3`
- $KERMIT -B -s $4 -a `basename $3` >/dev/null
+ cd `dirname "$4"`
+ hp48_cd `dirname "$3"`
+ $KERMIT -B -s $4 -a `basename "$3"` >/dev/null
exit 0;;
esac
exit 1
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]