From 8d25c02e51386bb0f463349e85400df9e07d94a7 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Fri, 3 Nov 2017 18:33:05 +0000 Subject: prevent possible infinite loops --- src/backend/functions_makepkg.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/backend/functions_makepkg.sh b/src/backend/functions_makepkg.sh index 47b007f..1c16d45 100644 --- a/src/backend/functions_makepkg.sh +++ b/src/backend/functions_makepkg.sh @@ -2,16 +2,18 @@ jailpkgprep () { while : true ; do - if [[ ! -d "$ropath" && ! -d "$rwpath" && ! -d "$workpath" && ! -d "$overlaypath" ]] ; then + if [[ ! -d "$ropath" || ! -d "$rwpath" || ! -d "$workpath" || ! -d "$overlaypath" ]] ; then + export local i for i in "$ropath" "$rwpath" "$workpath" "$overlaypath" ; do mkdir "$i" done jailpkgmnt break - elif [[ -d "$ropath" && -d "$rwpath" && -d "$workpath" && -d "$overlaypath" ]] ; then + elif [[ -d "$ropath" || -d "$rwpath" || -d "$workpath" || -d "$overlaypath" ]] ; then jailpkgdmnt - for i in "$ropath" "$rwpath" "$workpath" "$overlaypath" ; do - rm -rf "$i" + export local j + for j in "$ropath" "$rwpath" "$workpath" "$overlaypath" ; do + rm -rf "$j" done continue fi -- cgit v1.2.3