File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 9
9
10
10
11
11
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
+
12
20
promises = _ffi .NULL if promises is None else _encode (promises )
13
21
execpromises = _ffi .NULL if execpromises is None else _encode (execpromises )
14
22
ret = _lib .pledge (promises , execpromises )
@@ -18,6 +26,18 @@ def pledge(promises=None, execpromises=None):
18
26
19
27
20
28
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
+
21
41
path = _ffi .NULL if path is None else _encode (path )
22
42
permissions = _ffi .NULL if permissions is None else _encode (permissions )
23
43
ret = _lib .unveil (path , permissions )
You can’t perform that action at this time.
0 commit comments