]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Drop logic for using /root/.cache
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 25 Mar 2025 15:42:38 +0000 (16:42 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 25 Mar 2025 15:45:49 +0000 (16:45 +0100)
Let's just have root use the cache in /var/cache/mkosi to avoid accidentally
leaking files into /root/.cache accidentally where it's much less likely that
they'll ever get cleaned up.

mkosi/user.py

index 1550fd5aacea56248b9050df7cce8220cf05c84e..b4ca80a537723ba960ed89ba137603f492aa35aa 100644 (file)
@@ -24,8 +24,6 @@ class INVOKING_USER:
             cache = Path(env)
         elif cls.is_regular_user(os.getuid()) and Path.home() != Path("/"):
             cache = Path.home() / ".cache"
-        elif os.getuid() == 0 and Path.cwd().is_relative_to("/root") and "XDG_SESSION_ID" in os.environ:
-            cache = Path("/root/.cache")
         else:
             cache = Path("/var/cache")