fix permission logic

This commit is contained in:
aptalca
2019-04-01 10:44:33 -04:00
committed by Ryan Kuba
parent 5ad4d9489f
commit a157f54f20
3 changed files with 6 additions and 2 deletions

View File

@@ -174,6 +174,7 @@ Below are the instructions for updating containers:
## Versions ## Versions
* **01.04.19:** - Fix permission detect logic.
* **26.03.19:** - Install Heimdall during container start to prevent delayed start due to overlayfs bug with recursive chown. * **26.03.19:** - Install Heimdall during container start to prevent delayed start due to overlayfs bug with recursive chown.
* **23.03.19:** - Switching to new Base images, shift to arm32v7 tag. * **23.03.19:** - Switching to new Base images, shift to arm32v7 tag.
* **15.03.19:** - Clarify docker image tags in readme. * **15.03.19:** - Clarify docker image tags in readme.

View File

@@ -49,6 +49,7 @@ app_setup_block: |
# changelog # changelog
changelogs: changelogs:
- { date: "01.04.19:", desc: "Fix permission detect logic." }
- { date: "26.03.19:", desc: "Install Heimdall during container start to prevent delayed start due to overlayfs bug with recursive chown." } - { date: "26.03.19:", desc: "Install Heimdall during container start to prevent delayed start due to overlayfs bug with recursive chown." }
- { date: "23.03.19:", desc: "Switching to new Base images, shift to arm32v7 tag." } - { date: "23.03.19:", desc: "Switching to new Base images, shift to arm32v7 tag." }
- { date: "15.03.19:", desc: "Clarify docker image tags in readme." } - { date: "15.03.19:", desc: "Clarify docker image tags in readme." }

View File

@@ -42,10 +42,11 @@ sed -i 's/QUEUE_DRIVER=sync/QUEUE_DRIVER=database/' /config/www/.env
# function to randomly sample 5 files for their owner and only chown if not abc # function to randomly sample 5 files for their owner and only chown if not abc
chowner () { chowner () {
files=(${1}/*) files=(${1}/**)
for i in {1..5}; do for i in {1..50}; do
user=$(stat -c '%U' $(printf "%s\n" "${files[RANDOM % ${#files[@]}]}")) user=$(stat -c '%U' $(printf "%s\n" "${files[RANDOM % ${#files[@]}]}"))
if [ "${user}" != "abc" ]; then if [ "${user}" != "abc" ]; then
echo "chowning /config"
chown -R abc:abc ${1} chown -R abc:abc ${1}
break break
fi fi
@@ -54,6 +55,7 @@ done
# permissions # permissions
echo "Setting permissions" echo "Setting permissions"
shopt -s globstar
abc_dirs=( \ abc_dirs=( \
/config \ /config \
) )