Line
Link Here
|
0 |
-- bindings/python/Makefile.am |
0 |
++ bindings/python/Makefile.am |
Lines 29-35
Link Here
|
29 |
pyexec_PYTHON = capng.py |
29 |
pyexec_PYTHON = capng.py |
30 |
pyexec_LTLIBRARIES = _capng.la |
30 |
pyexec_LTLIBRARIES = _capng.la |
31 |
pyexec_SOLIBRARIES = _capng.so |
31 |
pyexec_SOLIBRARIES = _capng.so |
32 |
_capng_la_LDFLAGS = -module -avoid-version |
32 |
_capng_la_CFLAGS = -shared |
|
|
33 |
_capng_la_LDFLAGS = -module -avoid-version -shared |
33 |
_capng_la_HEADERS: $(top_builddir)/config.h |
34 |
_capng_la_HEADERS: $(top_builddir)/config.h |
34 |
_capng_la_DEPENDENCIES =${top_srcdir}/src/cap-ng.h ${top_builddir}/src/libcap-ng.la |
35 |
_capng_la_DEPENDENCIES =${top_srcdir}/src/cap-ng.h ${top_builddir}/src/libcap-ng.la |
35 |
nodist__capng_la_SOURCES = capng_wrap.c |
36 |
nodist__capng_la_SOURCES = capng_wrap.c |
36 |
-- bindings/python/test/capng-test.py |
37 |
++ bindings/python/test/capng-test.py |
Lines 10-24
Link Here
|
10 |
import capng |
10 |
import capng |
11 |
last = capng.CAP_LAST_CAP |
11 |
last = capng.CAP_LAST_CAP |
12 |
|
12 |
|
13 |
print "Doing basic bit tests..." |
13 |
print("Doing basic bit tests...") |
14 |
capng.capng_clear(capng.CAPNG_SELECT_BOTH) |
14 |
capng.capng_clear(capng.CAPNG_SELECT_BOTH) |
15 |
if capng.capng_have_capabilities(capng.CAPNG_SELECT_BOTH) != capng.CAPNG_NONE: |
15 |
if capng.capng_have_capabilities(capng.CAPNG_SELECT_BOTH) != capng.CAPNG_NONE: |
16 |
print "Failed clearing capabilities\n" |
16 |
print("Failed clearing capabilities\n") |
17 |
sys.exit(1) |
17 |
sys.exit(1) |
18 |
|
18 |
|
19 |
capng.capng_fill(capng.CAPNG_SELECT_BOTH) |
19 |
capng.capng_fill(capng.CAPNG_SELECT_BOTH) |
20 |
if capng.capng_have_capabilities(capng.CAPNG_SELECT_BOTH) != capng.CAPNG_FULL: |
20 |
if capng.capng_have_capabilities(capng.CAPNG_SELECT_BOTH) != capng.CAPNG_FULL: |
21 |
print "Failed filling capabilities" |
21 |
print("Failed filling capabilities") |
22 |
sys.exit(1) |
22 |
sys.exit(1) |
23 |
|
23 |
|
24 |
text = capng.capng_print_caps_numeric(capng.CAPNG_PRINT_BUFFER, capng.CAPNG_SELECT_CAPS) |
24 |
text = capng.capng_print_caps_numeric(capng.CAPNG_PRINT_BUFFER, capng.CAPNG_SELECT_CAPS) |
Lines 26-67
Link Here
|
26 |
if len < 80 and last > 30: |
26 |
if len < 80 and last > 30: |
27 |
last = 30 |
27 |
last = 30 |
28 |
|
28 |
|
29 |
print "Doing advanced bit tests for %d capabilities...\n" % (last) |
29 |
print("Doing advanced bit tests for %d capabilities...\n" % (last)) |
30 |
for i in range(last+1): |
30 |
for i in range(last+1): |
31 |
capng.capng_clear(capng.CAPNG_SELECT_BOTH) |
31 |
capng.capng_clear(capng.CAPNG_SELECT_BOTH) |
32 |
rc = capng.capng_update(capng.CAPNG_ADD, capng.CAPNG_EFFECTIVE, i) |
32 |
rc = capng.capng_update(capng.CAPNG_ADD, capng.CAPNG_EFFECTIVE, i) |
33 |
if rc: |
33 |
if rc: |
34 |
print "Failed update test 1" |
34 |
print("Failed update test 1") |
35 |
sys.exit(1) |
35 |
sys.exit(1) |
36 |
|
36 |
|
37 |
rc = capng.capng_have_capability(capng.CAPNG_EFFECTIVE, int(i)) |
37 |
rc = capng.capng_have_capability(capng.CAPNG_EFFECTIVE, int(i)) |
38 |
if rc <= capng.CAPNG_NONE: |
38 |
if rc <= capng.CAPNG_NONE: |
39 |
print "Failed have capability test 1" |
39 |
print("Failed have capability test 1") |
40 |
capng.capng_print_caps_numeric(capng.CAPNG_PRINT_STDOUT, capng.CAPNG_SELECT_CAPS) |
40 |
capng.capng_print_caps_numeric(capng.CAPNG_PRINT_STDOUT, capng.CAPNG_SELECT_CAPS) |
41 |
sys.exit(1) |
41 |
sys.exit(1) |
42 |
|
42 |
|
43 |
if capng.capng_have_capabilities(capng.CAPNG_SELECT_CAPS) != capng.CAPNG_PARTIAL: |
43 |
if capng.capng_have_capabilities(capng.CAPNG_SELECT_CAPS) != capng.CAPNG_PARTIAL: |
44 |
print "Failed have capabilities test 1" |
44 |
print("Failed have capabilities test 1") |
45 |
sys.exit(1) |
45 |
sys.exit(1) |
46 |
|
46 |
|
47 |
capng.capng_fill(capng.CAPNG_SELECT_BOTH) |
47 |
capng.capng_fill(capng.CAPNG_SELECT_BOTH) |
48 |
rc = capng.capng_update(capng.CAPNG_DROP, capng.CAPNG_EFFECTIVE, i) |
48 |
rc = capng.capng_update(capng.CAPNG_DROP, capng.CAPNG_EFFECTIVE, i) |
49 |
if rc: |
49 |
if rc: |
50 |
print "Failed update test 3" |
50 |
print("Failed update test 3") |
51 |
sys.exit(1) |
51 |
sys.exit(1) |
52 |
|
52 |
|
53 |
if capng.capng_have_capabilities(capng.CAPNG_SELECT_CAPS)!=capng.CAPNG_PARTIAL: |
53 |
if capng.capng_have_capabilities(capng.CAPNG_SELECT_CAPS)!=capng.CAPNG_PARTIAL: |
54 |
print "Failed have capabilities test 3" |
54 |
print("Failed have capabilities test 3") |
55 |
capng.capng_print_caps_numeric(capng.CAPNG_PRINT_STDOUT, capng.CAPNG_SELECT_CAPS) |
55 |
capng.capng_print_caps_numeric(capng.CAPNG_PRINT_STDOUT, capng.CAPNG_SELECT_CAPS) |
56 |
sys.exit(1) |
56 |
sys.exit(1) |
57 |
|
57 |
|
58 |
rc = capng.capng_update(capng.CAPNG_ADD, capng.CAPNG_EFFECTIVE, i) |
58 |
rc = capng.capng_update(capng.CAPNG_ADD, capng.CAPNG_EFFECTIVE, i) |
59 |
if rc: |
59 |
if rc: |
60 |
print "Failed update test 4" |
60 |
print("Failed update test 4") |
61 |
sys.exit(1) |
61 |
sys.exit(1) |
62 |
|
62 |
|
63 |
if capng.capng_have_capabilities(capng.CAPNG_SELECT_CAPS) != capng.CAPNG_FULL: |
63 |
if capng.capng_have_capabilities(capng.CAPNG_SELECT_CAPS) != capng.CAPNG_FULL: |
64 |
print "Failed have capabilities test 4" |
64 |
print("Failed have capabilities test 4") |
65 |
capng.capng_print_caps_numeric(capng.CAPNG_PRINT_STDOUT, capng.CAPNG_SELECT_CAPS) |
65 |
capng.capng_print_caps_numeric(capng.CAPNG_PRINT_STDOUT, capng.CAPNG_SELECT_CAPS) |
66 |
sys.exit(1) |
66 |
sys.exit(1) |
67 |
|
67 |
|