external/busybox
Revision | 945092bfb1a805451cfc7e5ad5ce3fa56df10058 (tree) |
---|---|
Time | 2017-09-08 20:30:00 |
Author | Chih-Wei Huang <cw_huang@asus...> |
Commiter | Chih-Wei Huang |
Fix building issues on Android 8.0
@@ -133,15 +133,6 @@ extern int selinux_check_passwd_access(access_vector_t requested); | ||
133 | 133 | |
134 | 134 | #define selinux_policy_root() "/sepolicy" |
135 | 135 | |
136 | -static int selinux_getenforcemode(int *rc) | |
137 | -{ | |
138 | - if (rc) { | |
139 | - *rc = security_getenforce(); | |
140 | - return 0; | |
141 | - } | |
142 | - return -1; | |
143 | -} | |
144 | - | |
145 | 136 | static const char *selinux_file_contexts_path() |
146 | 137 | { |
147 | 138 | return "/file_contexts"; |
@@ -33,8 +33,10 @@ | ||
33 | 33 | # if ENABLE_FEATURE_IPV6 |
34 | 34 | # include <netinet/in6.h> |
35 | 35 | # endif |
36 | -# define ANDROID_CHANGES | |
37 | 36 | # ifdef BIONIC_L |
37 | +# ifndef BIONIC_O | |
38 | +# define ANDROID_CHANGES | |
39 | +# endif | |
38 | 40 | # include <arpa/nameser.h> |
39 | 41 | # include <dns/include/resolv_private.h> |
40 | 42 | # include <dns/resolv/res_private.h> |
@@ -23,6 +23,15 @@ extern char *selinux_mnt; | ||
23 | 23 | |
24 | 24 | #define COL_FMT "%-31s " |
25 | 25 | |
26 | +static int internal_selinux_getenforcemode(int *rc) | |
27 | +{ | |
28 | + if (rc) { | |
29 | + *rc = security_getenforce(); | |
30 | + return 0; | |
31 | + } | |
32 | + return -1; | |
33 | +} | |
34 | + | |
26 | 35 | static void display_boolean(void) |
27 | 36 | { |
28 | 37 | char **bools; |
@@ -181,7 +190,7 @@ int sestatus_main(int argc UNUSED_PARAM, char **argv) | ||
181 | 190 | rc == 0 ? "permissive" : "enforcing"); |
182 | 191 | |
183 | 192 | /* Mode from config file: line */ |
184 | - if (selinux_getenforcemode(&rc) != 0) | |
193 | + if (internal_selinux_getenforcemode(&rc) != 0) | |
185 | 194 | goto error; |
186 | 195 | printf(COL_FMT "%s\n", "Mode from config file:", |
187 | 196 | rc < 0 ? "disabled" : (rc == 0 ? "permissive" : "enforcing")); |