From: Daan De Meyer Date: Wed, 31 Jan 2024 10:17:32 +0000 (+0100) Subject: Check if we can write to the cache directory before using it as the workspace X-Git-Tag: v21~77^2~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c8334d64a03ed1029951cec0bdc344919d6153a;p=thirdparty%2Fmkosi.git Check if we can write to the cache directory before using it as the workspace --- diff --git a/mkosi/config.py b/mkosi/config.py index 769acaee6..51b8985bc 100644 --- a/mkosi/config.py +++ b/mkosi/config.py @@ -1296,7 +1296,7 @@ class Config: if self.workspace_dir: return self.workspace_dir - if (cache := INVOKING_USER.cache_dir()) and cache != Path("/var/cache/mkosi"): + if (cache := INVOKING_USER.cache_dir()) and cache != Path("/var/cache/mkosi") and os.access(cache, os.W_OK): return cache return Path("/var/tmp")