summaryrefslogtreecommitdiff
path: root/linuxnamespaces
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2024-05-07 09:54:59 +0200
committerHelmut Grohne <helmut@subdivi.de>2024-05-07 09:54:59 +0200
commitcd0ada6b19b03bda74fcb81316aa104e0d1bbac6 (patch)
tree667a3becf5286a7056f14bb38bb7604c1aab62ca /linuxnamespaces
parentdde202c733fe9a30932f56b2fcfc2dfafa5d7a63 (diff)
downloadpython-linuxnamespaces-cd0ada6b19b03bda74fcb81316aa104e0d1bbac6.tar.gz
mount: allow data argument to be a list
Diffstat (limited to 'linuxnamespaces')
-rw-r--r--linuxnamespaces/syscalls.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/linuxnamespaces/syscalls.py b/linuxnamespaces/syscalls.py
index 986238c..368f437 100644
--- a/linuxnamespaces/syscalls.py
+++ b/linuxnamespaces/syscalls.py
@@ -511,7 +511,7 @@ def mount(
target: PathConvertible,
filesystemtype: str | None,
flags: MountFlags = MountFlags.NONE,
- data: str | None = None,
+ data: str | list[str] | None = None,
) -> None:
"""Python wrapper for mount(2)."""
if (flags & MountFlags.PROPAGATION_FLAGS).bit_count() > 1:
@@ -523,6 +523,10 @@ def mount(
)
):
raise ValueError("invalid flags for mount")
+ if isinstance(data, list):
+ if any("," in s for s in data):
+ raise ValueError("data elements must not contain a comma")
+ data = ",".join(data)
call_libc(
"mount",
os.fsencode(source),