Commit 1e7e575a authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 602eece1
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
// See COPYING file for full licensing terms. // See COPYING file for full licensing terms.
// See https://www.nexedi.com/licensing for rationale and options. // See https://www.nexedi.com/licensing for rationale and options.
// `capdo prog ...` executes prog with inherited capabilities. // Program `capdo prog ...` executes prog with inherited capabilities.
// It is used as trampoline to run script under setcap environment. // It is used as trampoline to run scripts under setcap environment.
#include <errno.h> #include <errno.h>
#include <stdarg.h> #include <stdarg.h>
...@@ -58,7 +58,7 @@ int main(int argc, const char *argv[]) { ...@@ -58,7 +58,7 @@ int main(int argc, const char *argv[]) {
} }
cap_set_proc(caps) && die_err("cap_set_proc"); cap_set_proc(caps) && die_err("cap_set_proc");
// raise ambient capabities to what is permitted/inheritable // raise ambient capabilities to what is permitted/inheritable
for (cap = 0; cap <= CAP_LAST_CAP; cap++) { for (cap = 0; cap <= CAP_LAST_CAP; cap++) {
if (capbits & (1ULL << cap)) if (capbits & (1ULL << cap))
prctl(PR_CAP_AMBIENT, PR_CAP_AMBIENT_RAISE, cap, 0, 0) && die_err("prctl ambient raise"); prctl(PR_CAP_AMBIENT, PR_CAP_AMBIENT_RAISE, cap, 0, 0) && die_err("prctl ambient raise");
......
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