summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xexamples/userchroot.py4
-rw-r--r--linuxnamespaces/__init__.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/examples/userchroot.py b/examples/userchroot.py
index 315a437..73d52b3 100755
--- a/examples/userchroot.py
+++ b/examples/userchroot.py
@@ -34,8 +34,8 @@ def main() -> None:
subuids = linuxnamespaces.IDAllocation.loadsubid("uid")
subgids = linuxnamespaces.IDAllocation.loadsubid("gid")
- uidmap = subuids.allocatemap(65536, 0)
- gidmap = subgids.allocatemap(65536, 0)
+ uidmap = subuids.allocatemap(65536)
+ gidmap = subgids.allocatemap(65536)
linuxnamespaces.unshare_user_idmap(
[uidmap],
diff --git a/linuxnamespaces/__init__.py b/linuxnamespaces/__init__.py
index 5d810b0..f44220a 100644
--- a/linuxnamespaces/__init__.py
+++ b/linuxnamespaces/__init__.py
@@ -126,7 +126,7 @@ class IDAllocation:
return start
raise ValueError("could not satisfy allocation request")
- def allocatemap(self, count: int, target: int) -> IDMapping:
+ def allocatemap(self, count: int, target: int = 0) -> IDMapping:
"""Allocate count contiguous ids from this allocation. An IDMapping
with its innerstart set to target is returned. The allocation is
removed from this IDAllocation object.