|
Lines 47-55
Link Here
|
| 47 |
# $2 is a name of a file within the archive |
47 |
# $2 is a name of a file within the archive |
| 48 |
# $3 is a name of a file within the system (to add from or extract to) |
48 |
# $3 is a name of a file within the system (to add from or extract to) |
| 49 |
{ |
49 |
{ |
| 50 |
TMPDIR=/tmp/mctmpdir.$$ |
50 |
TMPDIR=$(mktemp -t -d mctmpdir.XXXXXX) || exit 1 |
| 51 |
# FIXME bugzilla.eazel.com 1225: Try harder to generate a unique directory if this fails |
|
|
| 52 |
mkdir -m 0700 $TMPDIR || exit 1 |
| 53 |
cd $TMPDIR |
51 |
cd $TMPDIR |
| 54 |
uni_cat "$1" | cpio -icumd "$2" 2>/dev/null |
52 |
uni_cat "$1" | cpio -icumd "$2" 2>/dev/null |
| 55 |
mv "$2" "$3" |
53 |
mv "$2" "$3" |
|
Lines 62-67
Link Here
|
| 62 |
# |
60 |
# |
| 63 |
umask 077 |
61 |
umask 077 |
| 64 |
|
62 |
|
|
|
63 |
# XXX thomas: white list filter for arguments |
| 64 |
if ! [ -z "$2" ] |
| 65 |
CHECK=${2//[0-9a-zA-Z]/} |
| 66 |
if ! [ "$CHECK" = "" ]; then |
| 67 |
exit 1 |
| 68 |
fi |
| 69 |
fi |
| 70 |
if ! [ -z "$3" ] |
| 71 |
CHECK=${3//[0-9a-zA-Z]/} |
| 72 |
if ! [ "$CHECK" = "" ]; then |
| 73 |
exit 1 |
| 74 |
fi |
| 75 |
fi |
| 76 |
if ! [ -z "$4" ] |
| 77 |
CHECK=${4//[0-9a-zA-Z]/} |
| 78 |
if ! [ "$CHECK" = "" ]; then |
| 79 |
exit 1 |
| 80 |
fi |
| 81 |
fi |
| 82 |
|
| 65 |
case "$1" in |
83 |
case "$1" in |
| 66 |
list) mccpiofs_list $2 |
84 |
list) mccpiofs_list $2 |
| 67 |
exit 0 |
85 |
exit 0 |