about summary refs log tree commit diff stats
path: root/openbsd/__init__.py
diff options
context:
space:
mode:
authorYuce Tekol <yucetekol@gmail.com>2019-05-05 08:52:05 +0300
committerYuce Tekol <yucetekol@gmail.com>2019-05-05 08:52:05 +0300
commit62068009edddfc54c5588f6894233bf8bbfa4f44 (patch)
tree2ac936290a1dd39f38272ef6a190b313ea7cedde /openbsd/__init__.py
parent255eb665172640f2315ca7e18d64c95927c6620a (diff)
downloadpyopenbsd-62068009edddfc54c5588f6894233bf8bbfa4f44.tar.gz
added doc strings
Diffstat (limited to 'openbsd/__init__.py')
-rw-r--r--openbsd/__init__.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/openbsd/__init__.py b/openbsd/__init__.py
index a688661..e73753b 100644
--- a/openbsd/__init__.py
+++ b/openbsd/__init__.py
@@ -9,6 +9,14 @@ _ffi = FFI()
 
 
 def pledge(promises=None, execpromises=None):
+    """Restrict system operations.
+    
+    `promises` is a space separated string or binary of promises or `None` for no restrictions.
+    `execpromises` has the same format as `promises` and contains promises when runing other binaries using `execve`, etc.
+
+    See: https://man.openbsd.org/pledge.2 for more information.
+    """
+
     promises = _ffi.NULL if promises is None else _encode(promises)
     execpromises = _ffi.NULL if execpromises is None else _encode(execpromises)
     ret = _lib.pledge(promises, execpromises)
@@ -18,6 +26,18 @@ def pledge(promises=None, execpromises=None):
 
 
 def unveil(path=None, permissions=None):
+    """Unveil parts of a restricted filesystem view.
+
+    `path` may be a string or a binary.
+    `permissions` should be a combination of:
+    * `r`: Make path available for read operations.
+    * `w`: Make path available for write operations.
+    * `x`: Make path available for execute operations.
+    * `c`: Allow path to be created and removed.
+
+    See: https://man.openbsd.org/unveil.2 for more information.
+    """
+
     path = _ffi.NULL if path is None else _encode(path)
     permissions = _ffi.NULL if permissions is None else _encode(permissions)
     ret = _lib.unveil(path, permissions)
ame/ranger.py?h=v1.7.2&id=9dc6fe07975ef2d489e5071f4e6d7223a33cb3b3'>^
08f08fb9 ^
654af129 ^
08f08fb9 ^
d8084b41 ^

99400080 ^
08f08fb9 ^

654af129 ^

0da832e8 ^
d8084b41 ^
cba63cf3 ^
b4250dbc ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52