From b1cef063a1b5eeee4b644053f5a7be401c508781 Mon Sep 17 00:00:00 2001 From: Constantine Grantcharov Date: Thu, 29 Jun 2017 08:31:33 -0400 Subject: [PATCH] Fix $HOME directory ownership permissions BUG: Creating a new directory under /home// from the /work folder does not work. In fact, going into the home directory and trying to run mkdir fails as well. SOLUTION: Turns out chown -R : was run on $HOME/* instead of on $HOME. This means that /home/ was still under the ownership of root:root, hence preventing any writes to non-root users. --- imagefiles/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imagefiles/entrypoint.sh b/imagefiles/entrypoint.sh index 15161e4..b4dcab0 100755 --- a/imagefiles/entrypoint.sh +++ b/imagefiles/entrypoint.sh @@ -27,7 +27,7 @@ if [[ -n $BUILDER_UID ]] && [[ -n $BUILDER_GID ]]; then export HOME=/home/${BUILDER_USER} shopt -s dotglob cp -r /root/* $HOME/ - chown -R $BUILDER_UID:$BUILDER_GID $HOME/* + chown -R $BUILDER_UID:$BUILDER_GID $HOME # Additional updates specific to the image if [[ -e /dockcross/pre_exec.sh ]]; then