From 5c038d2f12e55e40762c8bf41bae90481541dedc Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Fri, 13 Dec 2002 07:53:20 +0000 Subject: [PATCH] * extfs/uha.in: Strengthen quoting. Remove unnecessary space after filename. Update URL. Use safer temporary directory. --- vfs/ChangeLog | 3 +++ vfs/extfs/uha.in | 32 +++++++++++++++++++++----------- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/vfs/ChangeLog b/vfs/ChangeLog index 4e141eb4a..3517fa013 100644 --- a/vfs/ChangeLog +++ b/vfs/ChangeLog @@ -1,5 +1,8 @@ 2002-12-13 Pavel Roskin + * extfs/uha.in: Strengthen quoting. Remove unnecessary space + after filename. Update URL. Use safer temporary directory. + * extfs/uarj: New list-only implementation that doesn't need patched unarj. * extfs/unarj.diff: Remove. diff --git a/vfs/extfs/uha.in b/vfs/extfs/uha.in index 56100171a..4c3f5c8b7 100644 --- a/vfs/extfs/uha.in +++ b/vfs/extfs/uha.in @@ -4,11 +4,11 @@ # ver 0.1 Thu Apr 6 12:05:08 2000 HA=ha # for HA 0.999 Copyright (c) 1995 Harri Hirvola - # Source: ftp://sunsite.unc.edu/pub/Linux/compress/ha0999p-linux.tar.gz + # Source: ftp://ftp.ibiblio.org/pub/Linux/utils/compress/ha0999p-linux.tar.gz mchafs_list () { - eval $HA lf $1 2>/dev/null |@AWK@ -v uid=${UID-0} ' + eval $HA lf "$1" 2>/dev/null |@AWK@ -v uid=${UID-0} ' { date="JanFebMarAprMayJunJulAugSepOctNovDec" } /^===========/ {next} { @@ -22,22 +22,32 @@ mchafs_list () path=$2 getline if ($1~/^d.*/) next - printf "%s %s %-8d %-8d %8d %3s %2d %4d %s:%s %s%s \n",\ + printf "%s %s %-8d %-8d %8d %3s %2d %4d %s:%s %s%s\n",\ $1,1,0,0,filesize, substr(date,(a[2]-1)*3+1,3),a[3],a[1],t[1],t[2],\ path,filename } -}' 2>/dev/null +}' } mchafs_copyout () { - cd /tmp - eval $HA xy $1 $2 >/dev/null 2>&1 - mv -f $2 $3 + TMPDIR="/tmp/mctmpdir-uha.$$" + mkdir $TMPDIR || exit 1 + cd $TMPDIR + + eval $HA xy "$1" "$2" >/dev/null 2>&1 + mv -f "$2" "$3" + + cd / + rm -rf $TMPDIR } -case "$1" in - list) shift; mchafs_list $1; exit 0;; - copyout) shift; mchafs_copyout $1 $2 $3; exit 0;; +cmd="$1" +shift + +case "$cmd" in + list) mchafs_list "$@" ;; + copyout) mchafs_copyout "$@" ;; + *) exit 1 ;; esac -exit 1 +exit 0