Skip to content

Commit 6206800

Browse files
committed
added doc strings
1 parent 255eb66 commit 6206800

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

openbsd/__init__.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@
99

1010

1111
def pledge(promises=None, execpromises=None):
12+
"""Restrict system operations.
13+
14+
`promises` is a space separated string or binary of promises or `None` for no restrictions.
15+
`execpromises` has the same format as `promises` and contains promises when runing other binaries using `execve`, etc.
16+
17+
See: https://man.openbsd.org/pledge.2 for more information.
18+
"""
19+
1220
promises = _ffi.NULL if promises is None else _encode(promises)
1321
execpromises = _ffi.NULL if execpromises is None else _encode(execpromises)
1422
ret = _lib.pledge(promises, execpromises)
@@ -18,6 +26,18 @@ def pledge(promises=None, execpromises=None):
1826

1927

2028
def unveil(path=None, permissions=None):
29+
"""Unveil parts of a restricted filesystem view.
30+
31+
`path` may be a string or a binary.
32+
`permissions` should be a combination of:
33+
* `r`: Make path available for read operations.
34+
* `w`: Make path available for write operations.
35+
* `x`: Make path available for execute operations.
36+
* `c`: Allow path to be created and removed.
37+
38+
See: https://man.openbsd.org/unveil.2 for more information.
39+
"""
40+
2141
path = _ffi.NULL if path is None else _encode(path)
2242
permissions = _ffi.NULL if permissions is None else _encode(permissions)
2343
ret = _lib.unveil(path, permissions)

0 commit comments

Comments
 (0)