*/
const char *get_shell_name(void) FAST_FUNC;
+#if ENABLE_FEATURE_SETPRIV_CAPABILITIES || ENABLE_RUN_INIT
unsigned cap_name_to_number(const char *cap) FAST_FUNC;
void printf_cap(const char *pfx, unsigned cap_no) FAST_FUNC;
void drop_capability(int cap_ordinal) FAST_FUNC;
struct __user_cap_data_struct data[2]; \
}
void getcaps(void *caps) FAST_FUNC;
-
-unsigned cap_name_to_number(const char *name) FAST_FUNC;
-void printf_cap(const char *pfx, unsigned cap_no) FAST_FUNC;
+#endif
#if ENABLE_SELINUX
extern void renew_current_security_context(void) FAST_FUNC;
*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
-//kbuild:lib-$(CONFIG_PLATFORM_LINUX) += capability.o
+//kbuild:lib-$(CONFIG_FEATURE_SETPRIV_CAPABILITIES) += capability.o
+//kbuild:lib-$(CONFIG_RUN_INIT) += capability.o
#include <linux/capability.h>
// #include <sys/capability.h>
#include <sys/mount.h>
#if ENABLE_RUN_INIT
# include <sys/prctl.h>
+# ifndef PR_CAPBSET_READ
+# define PR_CAPBSET_READ 23
+# endif
+# ifndef PR_CAPBSET_DROP
+# define PR_CAPBSET_DROP 24
+# endif
# include <linux/capability.h>
// #include <sys/capability.h>
// This header is in libcap, but the functions are in libc.