]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Show a proper error message if /etc/subuid or /etc/subgid doesn't exist.
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 31 Oct 2024 11:00:52 +0000 (12:00 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 31 Oct 2024 18:14:04 +0000 (19:14 +0100)
mkosi/user.py

index 2fa7870ca1f3ce3c38b86d64215a1fade2d2171b..c74523e3358dbfc646488ef173c0d8d7154df738 100644 (file)
@@ -82,6 +82,9 @@ class INVOKING_USER:
 
 
 def read_subrange(path: Path) -> int:
+    if not path.exists():
+        die(f"{path} does not exist, cannot allocate subuid/subgid user namespace")
+
     uid = str(os.getuid())
     try:
         user = pwd.getpwuid(os.getuid()).pw_name