]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Add quotes to protect against white space in build dir name.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Fri, 30 Nov 2007 11:14:57 +0000 (12:14 +0100)
committerJim Meyering <meyering@redhat.com>
Fri, 30 Nov 2007 11:14:57 +0000 (12:14 +0100)
* 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.

ChangeLog
tests/check.mk
tests/chmod/setgid
tests/misc/help-version
tests/misc/pwd-unreadable-parent
tests/rmdir/ignore
tests/test-lib.sh

index 4965e64e9e47e113b39e191d1d74331b214af945..f9d861d848147da224312c6308581586ef9124ec 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2007-11-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
+       Add quotes to protect against white space in build dir name.
+       * 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.
+
        Define `tst', for CU_TEST_NAME.
        * build-aux/check.mk (am__check_pre): Set `tst', for
        CU_TEST_NAME in tests/check.mk.
index c33aa892218f73d7cd5c03087fcc1d103910a73c..63f11e4493cc3f9b0747310a1997d034186afaeb 100644 (file)
@@ -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)                                 \
index 0c583f2745609615e20432bfe0aa9b289bf8b715..a91c6a58146247b1d561dba1f8b7a09f2dcba992 100755 (executable)
@@ -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
index 6da675f38f4ff8d185a82115bd43c511c98663c1..6c1565dcdfe772bb0591480606af271261e16fce 100755 (executable)
@@ -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
index 57557c6731d623b7bc8a96b493cb2ecb6deeba00..f3ff874d8116f646fbacacb0007c0483462f526a 100755 (executable)
@@ -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
index 6ad89577c6ddbdd6a2c4de481f77968b4002a74e..bb3f62f2e1f34509b3335ed38376df339adc9f09 100755 (executable)
@@ -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
index b90f98ff7610e3e7635b2ea7cf8be40f642552e6..8872b27b174f22ee57478cf7a5f0f4401878a857 100644 (file)
@@ -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 "$@"; }