diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-11-03 18:33:05 +0000 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-11-03 18:33:05 +0000 |
commit | 8d25c02e51386bb0f463349e85400df9e07d94a7 (patch) | |
tree | 408b4aafe1c7bb8aebaf530cc6249e80900e1b4c /src/backend | |
parent | a66a55b656483ce7465ee6c7046e9f2b8951ba34 (diff) |
prevent possible infinite loops
Diffstat (limited to 'src/backend')
-rw-r--r-- | src/backend/functions_makepkg.sh | 10 |
1 files 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 |