Clamp CAP_LAST_CAP at /proc/sys/kernel/cap_last_cap's value in the Python bindings test if possible, otherwise use the value from <linux/capability.h> since the kernel now has 37 capabilities upstream, but our builders are not that up to date.
15 lines
558 B
Diff
15 lines
558 B
Diff
diff -Nur libcap-ng-0.7.4/bindings/python/test/capng-test.py libcap-ng-0.7.4-2/bindings/python/test/capng-test.py
|
|
--- libcap-ng-0.7.4/bindings/python/test/capng-test.py 2014-04-24 08:41:44.000000000 -0400
|
|
+++ libcap-ng-0.7.4-2/bindings/python/test/capng-test.py 2014-06-23 13:25:20.113624203 -0400
|
|
@@ -8,7 +8,10 @@
|
|
sys.path.insert(0, load_path)
|
|
|
|
import capng
|
|
+
|
|
last = capng.CAP_LAST_CAP
|
|
+with open('/proc/sys/kernel/cap_last_cap', 'r') as f:
|
|
+ last = int(f.readline())
|
|
|
|
print("Doing basic bit tests...")
|
|
capng.capng_clear(capng.CAPNG_SELECT_BOTH)
|