From 2e47ab9b8c4526d1663da4aa3122b013237aaf9f Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Fri, 7 Jul 2017 11:50:33 +0200 Subject: [PATCH] tests: secure rm call Use "${var:?}" to ensure this never expands to / . (Should never happen as 'dir' was supposed to exist from preceding test.) --- test/shell/profiles-thin.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/shell/profiles-thin.sh b/test/shell/profiles-thin.sh index 81ac90b7b..9c9fadfad 100644 --- a/test/shell/profiles-thin.sh +++ b/test/shell/profiles-thin.sh @@ -62,7 +62,7 @@ vgremove -ff $vg if test -d "$DM_DEV_DIR/$vg" ; then should not echo "Udev has left \"$DM_DEV_DIR/$vg\"!" - rm -rf "$DM_DEV_DIR/$vg" + rm -rf "${DM_DEV_DIR:?/dev}/$vg" fi # The profile must be also applied if using the profile -- 2.43.5