[PATCH] protect against bogus absolute srcdir name

Jim Meyering meyering at redhat.com
Fri Jun 6 07:40:59 UTC 2008


* test-lib.sh: add quotes to protect against $abs_top_srcdir containing
shell meta-characters
---
 tests/test-lib.sh |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/test-lib.sh b/tests/test-lib.sh
index 8b76f6b..e78fd30 100644
--- a/tests/test-lib.sh
+++ b/tests/test-lib.sh
@@ -284,11 +284,12 @@ do
 	esac
 done

-test_dir_rand_=3D$($abs_top_srcdir/build-aux/mktempd $test_dir_ parted-$th=
is_test.XXXXXXXXXX) \
+test_dir_rand_=3D$("$abs_top_srcdir/build-aux/mktempd" $test_dir_ \
+      parted-$this_test.XXXXXXXXXX) \
     || error "failed to create temporary directory in $test_dir_"

 if test $skip_ =3D 0 && test "x$device_mapper_required_" !=3D 'x'; then
-  . $abs_top_srcdir/tests/dm-utils.sh || exit 1
+  . "$abs_top_srcdir/tests/dm-utils.sh" || exit 1
 fi

 # Run each test from within a temporary sub-directory named after the
--=20
1.5.6.rc0.30.g7c3f3




More information about the parted-devel mailing list