aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2017-07-07 17:59:40 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2017-07-07 17:59:40 +0200
commitb0c0b6d5ba4b15069a1e4ce6750c0ef2e93579e1 (patch)
treec8daa044ecfe9a23a86302e0ff63696a5fe139de
parent2bfe7838abd64efa7b18d7d428c5477669f967b0 (diff)
downloadbusybox-b0c0b6d5ba4b15069a1e4ce6750c0ef2e93579e1.tar.gz
setpriv: remove dependency on libcap headers
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--util-linux/setpriv.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/util-linux/setpriv.c b/util-linux/setpriv.c
index 3a7e68006..3d8dfea52 100644
--- a/util-linux/setpriv.c
+++ b/util-linux/setpriv.c
@@ -81,7 +81,14 @@
#if ENABLE_FEATURE_SETPRIV_CAPABILITIES
#include <linux/capability.h>
-#include <sys/capability.h>
+// #include <sys/capability.h>
+// This header is in libcap, but the functions are in libc.
+// Comment in the header says this above capset/capget:
+/* system calls - look to libc for function to system call mapping */
+extern int capset(cap_user_header_t header, cap_user_data_t data);
+extern int capget(cap_user_header_t header, const cap_user_data_t data);
+// so for bbox, let's just repeat the declarations.
+// This way, libcap needs not be installed in build environment.
#endif
#include <sys/prctl.h>
#include "libbb.h"