]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Check if we can write to the cache directory before using it as the workspace
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 31 Jan 2024 10:17:32 +0000 (11:17 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 31 Jan 2024 13:24:43 +0000 (14:24 +0100)
mkosi/config.py

index 769acaee6c096314f52fae3d391af40bb34f03c4..51b8985bc5364f5c69486695bd6f71915a131237 100644 (file)
@@ -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")