Skip to content

Commit bd9ee5e

Browse files
authored
Merge pull request #15 from desultory/dev
set default uid map to 100000:65536 for root
2 parents 8a65551 + 811ed73 commit bd9ee5e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/zenlib/namespace/namespace.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ def get_id_map(username=None, id_type="uid"):
1111
if id_type not in ("uid", "gid"):
1212
raise ValueError("id_type must be 'uid' or 'gid'")
1313

14+
if getuid() == 0:
15+
return 100000, 65536 # Not usre about this, unshare --map-auto --map-root seems to do this if run as root
16+
1417
with open(f"/etc/sub{id_type}") as f:
1518
for line in f:
1619
if line.startswith(f"{username}:"):

0 commit comments

Comments
 (0)