summaryrefslogtreecommitdiffstatshomepage
path: root/scripts/canonical.py
diff options
context:
space:
mode:
authorsommerfeld <sommerfeld@sommerfeld.dev>2026-09-18 08:58:12 +0100
committersommerfeld <sommerfeld@sommerfeld.dev>2026-09-18 08:58:12 +0100
commit0bb7afe1e5e6e3240e6d6211b01c1674a363347c (patch)
tree35183dba6b244b31469104795f9922bcd3eacf37 /scripts/canonical.py
parentf5f9bdee476114e4f345de320631aee9ea247861 (diff)
downloaddotfiles-0bb7afe1e5e6e3240e6d6211b01c1674a363347c.tar.gz
dotfiles-0bb7afe1e5e6e3240e6d6211b01c1674a363347c.tar.bz2
dotfiles-0bb7afe1e5e6e3240e6d6211b01c1674a363347c.zip
Assign missing subordinate IDs during corporate setup
Diffstat (limited to 'scripts/canonical.py')
-rw-r--r--scripts/canonical.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/scripts/canonical.py b/scripts/canonical.py
index db7f773..6fd83d6 100644
--- a/scripts/canonical.py
+++ b/scripts/canonical.py
@@ -108,15 +108,20 @@ def check(lab: bool = False) -> None:
["gnome-extensions", "list", "--enabled"],
["flatpak", "list", "--user", "--app"],
*[["flatpak", "info", "--user", app] for app in packages("flatpak")],
- ["getent", "passwd", str(os.getuid())],
- ["getsubids", os.environ.get("USER", "")],
- ["getsubids", "-g", os.environ.get("USER", "")],
+ ["/usr/bin/getent", "passwd", str(os.getuid())],
+ ["/usr/bin/getsubids", os.environ.get("USER", "")],
+ ["/usr/bin/getsubids", "-g", os.environ.get("USER", "")],
]
failed = False
for command in commands:
print("\n> " + " ".join(command), flush=True)
try:
- failed |= subprocess.run(command, check=False).returncode != 0
+ result = subprocess.run(command, check=False)
+ failed |= result.returncode != 0
+ if result.returncode and command[0] == "/usr/bin/getsubids":
+ print(
+ "Subordinate IDs unavailable. Run just canonical-system to configure local ranges."
+ )
except FileNotFoundError:
print(f"Missing: {command[0]}")
failed = True