Commit 602eece1 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 4832ece7
......@@ -84,7 +84,7 @@ md5sum = b547df6f6efe841466def20531770923
[ru_capdo.c]
_update_hash_filename_ = ru/capdo.c
md5sum = 71b28403a04cc7bf756aac7e28fa97f1
md5sum = dcbf6b53616351bcd3e52b5cb12e688a
[template-enb]
_update_hash_filename_ = instance-enb.jinja2.cfg
......
......@@ -23,7 +23,7 @@ parts +=
recipe = plone.recipe.command
exe = ${buildout:directory}/netcapdo
command = gcc ${:ccflags} -o ${:exe} ${ru_capdo.c:target} -lcap
ccflags = -I${libcap:location}/include -L${libcap:location}/lib
ccflags = -I${libcap:location}/include -L${libcap:location}/lib -Wl,-rpath=${libcap:location}/lib
stop-on-error = true
[setcap-netcapdo]
......
......@@ -46,7 +46,11 @@ int main(int argc, const char *argv[]) {
if (!caps)
die("cap_get_proc failed");
for (cap = 0; cap < CAP_LAST_CAP; cap++) {
cap_get_flag(caps, cap, CAP_PERMITTED, &flag) && die_err("cap_get_flag");
if (cap_get_flag(caps, cap, CAP_PERMITTED, &flag)) {
if (errno = EINVAL)
continue; // this cap is not supported by running kernel
die_err("cap_get_flag");
}
if (flag) {
cap_set_flag(caps, CAP_INHERITABLE, 1, &cap, flag) && die_err("cap_set_flag");
capbits |= (1ULL << cap);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment