diff options
author | Erich Eckner <git@eckner.net> | 2019-05-20 13:08:33 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2019-05-20 13:08:33 +0200 |
commit | 1476a70e18cbf914b02f8b400e1b7cd08cbeb2fa (patch) | |
tree | 07baf1c4d71852a75214e3b4e93f25116790a4b4 /lib | |
parent | 8d217771652d5b8a4c14ac1e98a2cb20328d5c88 (diff) | |
download | builder-1476a70e18cbf914b02f8b400e1b7cd08cbeb2fa.tar.xz |
lib/common-functions: recursively_umount_and_rm(): check that argument is directory
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/common-functions | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/common-functions b/lib/common-functions index 9ba495c..6ff5b2c 100755 --- a/lib/common-functions +++ b/lib/common-functions @@ -390,6 +390,12 @@ recursively_umount_and_rm() { exit 42 fi + if [ ! -d "${dir}" ]; then + >&2 printf 'ERROR: recursively_umount_and_rm requires a directory as argument - "%s" is not\n' \ + "${dir}" + exit 42 + fi + # the sh -c '...' construct branch below is borrowed from # archlinux/devtools lib/archroot.sh: is_subvolume(), is_same_fs() and # subvolume_delete_recursive() |