Allow root to create cache directories as a non-root user
This change ensures that cache directories are owned by a non-root
user even if the process is running as root.
BUG=chromium:312420
TEST=unittests + tryjobs
Change-Id: I1336c547c7a8580e26fab7c24cf2382e9115d5a3
Reviewed-on: https://chromium-review.googlesource.com/174893
Reviewed-by: David James <davidjames@chromium.org>
Commit-Queue: Yu-Ju Hong <yjhong@chromium.org>
Tested-by: Yu-Ju Hong <yjhong@chromium.org>
diff --git a/scripts/cbuildbot.py b/scripts/cbuildbot.py
index 6bb322a..92ec3c2 100644
--- a/scripts/cbuildbot.py
+++ b/scripts/cbuildbot.py
@@ -1308,7 +1308,7 @@
options.cache_dir = os.path.abspath(options.cache_dir)
parser.ConfigureCacheDir(options.cache_dir)
- osutils.SafeMakedirs(options.cache_dir)
+ osutils.SafeMakedirsNonRoot(options.cache_dir)
if options.local_patches:
options.local_patches = _CheckLocalPatches(