[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
fixes for whitespace in `pwd`
From: |
Ralf Wildenhues |
Subject: |
fixes for whitespace in `pwd` |
Date: |
Fri, 30 Nov 2007 06:52:00 +0100 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
Hi Jim,
Please consider this patch to fix some quoting errors for whitespace in
the build dir name.
There seems to be at least one more instance, in
tests/misc/ls-misc: the command starting with
| system (qq(touch setuid && chmod u+s setuid && $test -u setuid &
looks like all instances of $test in there need escaping/quoting.
I'm not brave enough to try the test as empowered user, though.
Cheers,
Ralf
2007-11-30 Ralf Wildenhues <address@hidden>
* tests/check.mk (TESTS_ENVIRONMENT): Quote $(abs_srcdir).
* tests/chmod/setgid: Quote absolute names.
* tests/misc/help-version: Likewise.
* tests/misc/pwd-unreadable-parent: Likewise.
* tests/rmdir/ignore: Likewise.
* tests/test-lib.sh: Likewise.
diff --git a/tests/check.mk b/tests/check.mk
index c33aa89..98478f0 100644
--- a/tests/check.mk
+++ b/tests/check.mk
@@ -43,7 +43,7 @@ TESTS_ENVIRONMENT = \
srcdir='$(srcdir)' \
top_srcdir='$(top_srcdir)' \
CONFIG_HEADER='$(CONFIG_HEADER)' \
- CU_TEST_NAME=`basename $(abs_srcdir)`,$$tst \
+ CU_TEST_NAME=`basename "$(abs_srcdir)"`,$$tst \
EGREP='$(EGREP)' \
EXEEXT='$(EXEEXT)' \
MAKE=$(MAKE) \
diff --git a/tests/chmod/setgid b/tests/chmod/setgid
index 0c583f2..a91c6a5 100755
--- a/tests/chmod/setgid
+++ b/tests/chmod/setgid
@@ -30,7 +30,7 @@ test=$abs_top_builddir/src/test
umask 0
mkdir d || framework_failure
-chmod g+s d 2> /dev/null && $test -g d ||
+chmod g+s d 2> /dev/null && "$test" -g d ||
{
# This is required because on some systems (at least NetBSD 1.4.2A),
# it may happen that when you create a directory, its group isn't one
@@ -44,7 +44,7 @@ chmod g+s d 2> /dev/null && $test -g d ||
}
# "chmod g+s d" does nothing on some NFS file systems.
-$test -g d || {
+"$test" -g d || {
echo 1>&2 "$0: cannot create setgid directories," \
"so can't run this test"
exit 77
diff --git a/tests/misc/help-version b/tests/misc/help-version
index 6da675f..6c1565d 100755
--- a/tests/misc/help-version
+++ b/tests/misc/help-version
@@ -75,9 +75,9 @@ for lang in C fr da; do
# false fails even when invoked with --help or --version.
if test $i = false; then
- env LC_MESSAGES=$lang $abs_top_builddir/src/$i --help \
+ env LC_MESSAGES=$lang "$abs_top_builddir/src/$i" --help \
>/dev/null && fail=1
- env LC_MESSAGES=$lang $abs_top_builddir/src/$i --version \
+ env LC_MESSAGES=$lang "$abs_top_builddir/src/$i" --version \
>/dev/null && fail=1
continue
fi
@@ -86,8 +86,8 @@ for lang in C fr da; do
test $i = install && i=ginstall
# Make sure they exit successfully, under normal conditions.
- $abs_top_builddir/src/$i --help > h-$i || fail=1
- $abs_top_builddir/src/$i --version >/dev/null || fail=1
+ "$abs_top_builddir/src/$i" --help > h-$i || fail=1
+ "$abs_top_builddir/src/$i" --version >/dev/null || fail=1
# Make sure they mention the bug-reporting address in --help output.
grep "$PACKAGE_BUGREPORT" h-$i > /dev/null || fail=1
@@ -95,8 +95,8 @@ for lang in C fr da; do
# Make sure they fail upon `disk full' error.
if test -w /dev/full && test -c /dev/full; then
- $abs_top_builddir/src/$i --help >/dev/full 2>/dev/null && fail=1
- $abs_top_builddir/src/$i --version >/dev/full 2>/dev/null && fail=1
+ "$abs_top_builddir/src/$i" --help >/dev/full 2>/dev/null && fail=1
+ "$abs_top_builddir/src/$i" --version >/dev/full 2>/dev/null && fail=1
status=$?
test $i = [ && prog=lbracket || prog=$i
eval "expected=\$expected_failure_status_$prog"
@@ -213,7 +213,7 @@ for i in $built_programs; do
# echo ================== $i
test $i = [ && prog=lbracket || prog=$i
eval "args=\$${prog}_args"
- if $abs_top_builddir/src/$i $args < $tmp_in > $tmp_out; then
+ if "$abs_top_builddir/src/$i" $args < $tmp_in > $tmp_out; then
: # ok
else
echo FAIL: $i
diff --git a/tests/misc/pwd-unreadable-parent b/tests/misc/pwd-unreadable-parent
index 57557c6..f3ff874 100755
--- a/tests/misc/pwd-unreadable-parent
+++ b/tests/misc/pwd-unreadable-parent
@@ -47,7 +47,7 @@ chmod a=x .. || framework_failure
pwd_exe="$abs_top_builddir/src/pwd"
fail=0
-$pwd_exe > exp || fail=1
+"$pwd_exe" > exp || fail=1
readlink -ev . > out || fail=1
compare out exp || fail=1
diff --git a/tests/rmdir/ignore b/tests/rmdir/ignore
index 6ad8957..bb3f62f 100755
--- a/tests/rmdir/ignore
+++ b/tests/rmdir/ignore
@@ -24,14 +24,14 @@ fi
. $srcdir/../test-lib.sh
cwd=`pwd`
-mkdir -p $cwd/a/b/c $cwd/a/x || framework_failure
+mkdir -p "$cwd/a/b/c" "$cwd/a/x" || framework_failure
fail=0
-rmdir -p --ignore-fail-on-non-empty $cwd/a/b/c || fail=1
+rmdir -p --ignore-fail-on-non-empty "$cwd/a/b/c" || fail=1
# $cwd/a/x should remain
-test -d $cwd/a/x || fail=1
+test -d "$cwd/a/x" || fail=1
# $cwd/a/b and $cwd/a/b/c should be gone
-test -d $cwd/a/b && fail=1
-test -d $cwd/a/b/c && fail=1
+test -d "$cwd/a/b" && fail=1
+test -d "$cwd/a/b/c" && fail=1
exit $fail
diff --git a/tests/test-lib.sh b/tests/test-lib.sh
index b90f98f..8872b27 100644
--- a/tests/test-lib.sh
+++ b/tests/test-lib.sh
@@ -80,7 +80,7 @@ this_test=$(this_test_)
# a partition, or to undo any other global state changes.
cleanup_() { :; }
-t_=$($abs_top_builddir/src/mktemp -d --tmp="$test_dir_"
cu-$this_test.XXXXXXXXXX)\
+t_=$("$abs_top_builddir/src/mktemp" -d --tmp="$test_dir_"
cu-$this_test.XXXXXXXXXX)\
|| error_ "failed to create temporary directory in $test_dir_"
# Run each test from within a temporary sub-directory named after the
@@ -89,7 +89,7 @@ trap 'st=$?; cleanup_; d='"$t_"';
cd '"$test_dir_"' && chmod -R u+rwx "$d" && rm -rf "$d" && exit $st' 0
trap '(exit $?); exit $?' 1 2 13 15
-cd $t_ || error_ "failed to cd to $t_"
+cd "$t_" || error_ "failed to cd to $t_"
if ( diff --version < /dev/null 2>&1 | grep GNU ) 2>&1 > /dev/null; then
compare() { diff -u "$@"; }
- fixes for whitespace in `pwd`,
Ralf Wildenhues <=