Skip to contentSkip to conversation

master - tests: secure rm call

PATCH Zdenek Kabelac 1 participant 1 message Jul 10, 2017

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=2e47ab9b8c4526d1663da4aa3122b013237aaf9f
Commit:        2e47ab9b8c4526d1663da4aa3122b013237aaf9f
Parent:        4ed3f1bee3fca0b27ace8bfe593aa6aee15a3a19
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Fri Jul 7 11:50:33 2017 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Mon Jul 10 14:23:53 2017 +0200

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 files changed, 1 insertions(+), 1 deletions(-)
test/shell/profiles-thin.sh +1 -1
index 81ac90b..9c9fadf 100644
@@ -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