From fa4a6027183857a7688ba3c66fbe945e017cef92 Mon Sep 17 00:00:00 2001 From: Ryan Luckie Date: Thu, 2 Jul 2020 10:14:52 -0500 Subject: [PATCH] Fix permissions for XDG like paths - If user mounts paths in a XDG path the mount permission can break other tools what use XDG paths --- files/usr/local/bin/provision-user | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/files/usr/local/bin/provision-user b/files/usr/local/bin/provision-user index 921f271..564958b 100755 --- a/files/usr/local/bin/provision-user +++ b/files/usr/local/bin/provision-user @@ -56,6 +56,12 @@ if [[ ! -f "/etc/kdk/provisioned" ]]; then # Ensure permissions for a few locations chown ${KDK_USERNAME}:${KDK_USERNAME} /home/${KDK_USERNAME} + for item in config cache local; do + ITEM_PATH="/home/${KDK_USERNAME}/.${item}" + if [[ -d "${ITEM_PATH}" ]]; then + chown -R ${KDK_USERNAME}:${KDK_USERNAME} ${ITEM_PATH} + fi + done chown -R ${KDK_USERNAME}:${KDK_USERNAME} /go install -m 0600 -o ${KDK_USERNAME} /dev/null /var/log/kdk-provision.log