From 49b779927182f8a6f51ed64adb99735e1368848e Mon Sep 17 00:00:00 2001 From: SKP Date: Sun, 20 Jan 2019 12:44:02 +0100 Subject: [PATCH 1/2] Check if var with current directory is empty to prevent infinite loop --- dist/setup.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dist/setup.sh b/dist/setup.sh index 708361a..b7b7bd5 100755 --- a/dist/setup.sh +++ b/dist/setup.sh @@ -528,6 +528,9 @@ check_directory_owner() { local status=0 for d in "${directories[@]}" do + if [[ ''$d == '' ]]; then + continue + fi if [[ -e $d ]]; then # is it mine and does it have rw ? # don't care about group rights From ed62ef409f25ac6c23663b0407fd687edbce69f2 Mon Sep 17 00:00:00 2001 From: SKP Date: Sun, 20 Jan 2019 13:00:04 +0100 Subject: [PATCH 2/2] using absolute paths in check_directory_owner() --- dist/setup.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/dist/setup.sh b/dist/setup.sh index b7b7bd5..592f1dd 100755 --- a/dist/setup.sh +++ b/dist/setup.sh @@ -531,6 +531,7 @@ check_directory_owner() { if [[ ''$d == '' ]]; then continue fi + d=$(realpath $d) if [[ -e $d ]]; then # is it mine and does it have rw ? # don't care about group rights