Fix $HOME directory ownership permissions

BUG:

Creating a new directory under /home/<user>/ 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 <user>:<user> was run on $HOME/* instead of on $HOME.
This means that /home/<user> was still under the ownership of root:root,
hence preventing any writes to non-root users.
This commit is contained in:
Constantine Grantcharov 2017-06-29 08:31:33 -04:00
parent 2b28515daf
commit b1cef063a1

View File

@ -27,7 +27,7 @@ if [[ -n $BUILDER_UID ]] && [[ -n $BUILDER_GID ]]; then
export HOME=/home/${BUILDER_USER} export HOME=/home/${BUILDER_USER}
shopt -s dotglob shopt -s dotglob
cp -r /root/* $HOME/ cp -r /root/* $HOME/
chown -R $BUILDER_UID:$BUILDER_GID $HOME/* chown -R $BUILDER_UID:$BUILDER_GID $HOME
# Additional updates specific to the image # Additional updates specific to the image
if [[ -e /dockcross/pre_exec.sh ]]; then if [[ -e /dockcross/pre_exec.sh ]]; then