diff options
-rw-r--r-- | include/libbb.h | 5 | ||||
-rw-r--r-- | libbb/capability.c | 3 | ||||
-rw-r--r-- | util-linux/switch_root.c | 6 |
3 files changed, 10 insertions, 4 deletions
diff --git a/include/libbb.h b/include/libbb.h index c02621d94..f1ab1ca6f 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -1488,6 +1488,7 @@ extern void run_shell(const char *shell, int loginshell, const char **args) NORE | |||
1488 | */ | 1488 | */ |
1489 | const char *get_shell_name(void) FAST_FUNC; | 1489 | const char *get_shell_name(void) FAST_FUNC; |
1490 | 1490 | ||
1491 | #if ENABLE_FEATURE_SETPRIV_CAPABILITIES || ENABLE_RUN_INIT | ||
1491 | unsigned cap_name_to_number(const char *cap) FAST_FUNC; | 1492 | unsigned cap_name_to_number(const char *cap) FAST_FUNC; |
1492 | void printf_cap(const char *pfx, unsigned cap_no) FAST_FUNC; | 1493 | void printf_cap(const char *pfx, unsigned cap_no) FAST_FUNC; |
1493 | void drop_capability(int cap_ordinal) FAST_FUNC; | 1494 | void drop_capability(int cap_ordinal) FAST_FUNC; |
@@ -1499,9 +1500,7 @@ struct caps { \ | |||
1499 | struct __user_cap_data_struct data[2]; \ | 1500 | struct __user_cap_data_struct data[2]; \ |
1500 | } | 1501 | } |
1501 | void getcaps(void *caps) FAST_FUNC; | 1502 | void getcaps(void *caps) FAST_FUNC; |
1502 | 1503 | #endif | |
1503 | unsigned cap_name_to_number(const char *name) FAST_FUNC; | ||
1504 | void printf_cap(const char *pfx, unsigned cap_no) FAST_FUNC; | ||
1505 | 1504 | ||
1506 | #if ENABLE_SELINUX | 1505 | #if ENABLE_SELINUX |
1507 | extern void renew_current_security_context(void) FAST_FUNC; | 1506 | extern void renew_current_security_context(void) FAST_FUNC; |
diff --git a/libbb/capability.c b/libbb/capability.c index f60062bfc..6587dcbf7 100644 --- a/libbb/capability.c +++ b/libbb/capability.c | |||
@@ -3,7 +3,8 @@ | |||
3 | * | 3 | * |
4 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 4 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
5 | */ | 5 | */ |
6 | //kbuild:lib-$(CONFIG_PLATFORM_LINUX) += capability.o | 6 | //kbuild:lib-$(CONFIG_FEATURE_SETPRIV_CAPABILITIES) += capability.o |
7 | //kbuild:lib-$(CONFIG_RUN_INIT) += capability.o | ||
7 | 8 | ||
8 | #include <linux/capability.h> | 9 | #include <linux/capability.h> |
9 | // #include <sys/capability.h> | 10 | // #include <sys/capability.h> |
diff --git a/util-linux/switch_root.c b/util-linux/switch_root.c index 2d1802b79..947dd0cdc 100644 --- a/util-linux/switch_root.c +++ b/util-linux/switch_root.c | |||
@@ -39,6 +39,12 @@ | |||
39 | #include <sys/mount.h> | 39 | #include <sys/mount.h> |
40 | #if ENABLE_RUN_INIT | 40 | #if ENABLE_RUN_INIT |
41 | # include <sys/prctl.h> | 41 | # include <sys/prctl.h> |
42 | # ifndef PR_CAPBSET_READ | ||
43 | # define PR_CAPBSET_READ 23 | ||
44 | # endif | ||
45 | # ifndef PR_CAPBSET_DROP | ||
46 | # define PR_CAPBSET_DROP 24 | ||
47 | # endif | ||
42 | # include <linux/capability.h> | 48 | # include <linux/capability.h> |
43 | // #include <sys/capability.h> | 49 | // #include <sys/capability.h> |
44 | // This header is in libcap, but the functions are in libc. | 50 | // This header is in libcap, but the functions are in libc. |