From 0f61d93e3aeeb216af8f023f2b2ada7100a65116 Mon Sep 17 00:00:00 2001 From: Michael Stucki Date: Mon, 16 Mar 2015 10:49:02 +0100 Subject: [PATCH] Fix permissions (transfer ownership from root to cmbuild) --- startup.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/startup.sh b/startup.sh index 4f6d817..12441c9 100644 --- a/startup.sh +++ b/startup.sh @@ -5,6 +5,15 @@ if [ ! -f /srv/ccache/CACHEDIR.TAG ]; then CCACHE_DIR=/srv/ccache ccache -M 50G fi +# Fix permissions. This is needed temporarily to migrate old projects which were still checked out as root. +# It can be removed at some point in the future. +# For performance reasons, only search on the first level. +for i in "/home/cmbuild/android" "/srv/ccache"; do + if [ $(find $i -maxdepth 1 -user root | wc -l) -gt 0 ]; then + chown -R cmbuild:cmbuild $i + fi +done + # Fix console permissions as long as https://github.com/docker/docker/issues/9806 is not fixed usermod --groups tty --append cmbuild chgrp tty /dev/console