diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-02-07 22:08:42 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-02-07 22:08:42 +0000 |
commit | 8c6c6e955b4a73b8a2cac8c0d277bc109b329908 (patch) | |
tree | ad6dfaea9873084f50c69e53f69fca0f22b68b8e | |
parent | 710694f0e5bae17ceba8c6f2694b856d6eab1c63 (diff) | |
download | busybox-w32-8c6c6e955b4a73b8a2cac8c0d277bc109b329908.tar.gz busybox-w32-8c6c6e955b4a73b8a2cac8c0d277bc109b329908.tar.bz2 busybox-w32-8c6c6e955b4a73b8a2cac8c0d277bc109b329908.zip |
selinux fixes by KaiGai Kohei <kaigai@kaigai.gr.jp>
-rw-r--r-- | selinux/getenforce.c | 1 | ||||
-rw-r--r-- | selinux/getsebool.c | 1 | ||||
-rw-r--r-- | selinux/matchpathcon.c | 5 | ||||
-rw-r--r-- | selinux/selinuxenabled.c | 1 | ||||
-rw-r--r-- | selinux/setenforce.c | 12 |
5 files changed, 11 insertions, 9 deletions
diff --git a/selinux/getenforce.c b/selinux/getenforce.c index e240e4dca..865fed9f2 100644 --- a/selinux/getenforce.c +++ b/selinux/getenforce.c | |||
@@ -8,6 +8,7 @@ | |||
8 | 8 | ||
9 | #include "busybox.h" | 9 | #include "busybox.h" |
10 | 10 | ||
11 | int getenforce_main(int argc, char **argv); | ||
11 | int getenforce_main(int argc, char **argv) | 12 | int getenforce_main(int argc, char **argv) |
12 | { | 13 | { |
13 | int rc; | 14 | int rc; |
diff --git a/selinux/getsebool.c b/selinux/getsebool.c index d593937ba..0479598fb 100644 --- a/selinux/getsebool.c +++ b/selinux/getsebool.c | |||
@@ -8,6 +8,7 @@ | |||
8 | 8 | ||
9 | #include "busybox.h" | 9 | #include "busybox.h" |
10 | 10 | ||
11 | int getsebool_main(int argc, char **argv); | ||
11 | int getsebool_main(int argc, char **argv) | 12 | int getsebool_main(int argc, char **argv) |
12 | { | 13 | { |
13 | int i, rc = 0, active, pending, len = 0; | 14 | int i, rc = 0, active, pending, len = 0; |
diff --git a/selinux/matchpathcon.c b/selinux/matchpathcon.c index 4fa95b0ef..c9ebbd795 100644 --- a/selinux/matchpathcon.c +++ b/selinux/matchpathcon.c | |||
@@ -29,6 +29,7 @@ static int print_matchpathcon(char *path, int noprint) | |||
29 | #define OPT_PREFIX (1<<3) /* -p */ | 29 | #define OPT_PREFIX (1<<3) /* -p */ |
30 | #define OPT_VERIFY (1<<4) /* -V */ | 30 | #define OPT_VERIFY (1<<4) /* -V */ |
31 | 31 | ||
32 | int matchpathcon_main(int argc, char **argv); | ||
32 | int matchpathcon_main(int argc, char **argv) | 33 | int matchpathcon_main(int argc, char **argv) |
33 | { | 34 | { |
34 | int error = 0; | 35 | int error = 0; |
@@ -41,7 +42,7 @@ int matchpathcon_main(int argc, char **argv) | |||
41 | argv += optind; | 42 | argv += optind; |
42 | 43 | ||
43 | if (opts & OPT_NOT_TRANS) { | 44 | if (opts & OPT_NOT_TRANS) { |
44 | set_matchpathcon_flags(NOTRANS); | 45 | set_matchpathcon_flags(MATCHPATHCON_NOTRANS); |
45 | } | 46 | } |
46 | if (opts & OPT_FCONTEXT) { | 47 | if (opts & OPT_FCONTEXT) { |
47 | if (matchpathcon_init(fcontext)) | 48 | if (matchpathcon_init(fcontext)) |
@@ -57,7 +58,7 @@ int matchpathcon_main(int argc, char **argv) | |||
57 | int rc; | 58 | int rc; |
58 | 59 | ||
59 | if (!(opts & OPT_VERIFY)) { | 60 | if (!(opts & OPT_VERIFY)) { |
60 | error += print_matchpathcon(path, opt & OPT_NOT_PRINT); | 61 | error += print_matchpathcon(path, opts & OPT_NOT_PRINT); |
61 | continue; | 62 | continue; |
62 | } | 63 | } |
63 | 64 | ||
diff --git a/selinux/selinuxenabled.c b/selinux/selinuxenabled.c index b34228098..400995af0 100644 --- a/selinux/selinuxenabled.c +++ b/selinux/selinuxenabled.c | |||
@@ -7,6 +7,7 @@ | |||
7 | */ | 7 | */ |
8 | #include "busybox.h" | 8 | #include "busybox.h" |
9 | 9 | ||
10 | int selinuxenabled_main(int argc, char **argv); | ||
10 | int selinuxenabled_main(int argc, char **argv) | 11 | int selinuxenabled_main(int argc, char **argv) |
11 | { | 12 | { |
12 | return !is_selinux_enabled(); | 13 | return !is_selinux_enabled(); |
diff --git a/selinux/setenforce.c b/selinux/setenforce.c index 670e30086..9204fcc39 100644 --- a/selinux/setenforce.c +++ b/selinux/setenforce.c | |||
@@ -8,12 +8,9 @@ | |||
8 | 8 | ||
9 | #include "busybox.h" | 9 | #include "busybox.h" |
10 | 10 | ||
11 | static const smallint setenforce_mode[] = { | 11 | /* These strings are arranged so that odd ones |
12 | 0, | 12 | * result in security_setenforce(1) being done, |
13 | 1, | 13 | * the rest will do security_setenforce(0) */ |
14 | 0, | ||
15 | 1, | ||
16 | }; | ||
17 | static const char *const setenforce_cmd[] = { | 14 | static const char *const setenforce_cmd[] = { |
18 | "0", | 15 | "0", |
19 | "1", | 16 | "1", |
@@ -22,6 +19,7 @@ static const char *const setenforce_cmd[] = { | |||
22 | NULL, | 19 | NULL, |
23 | }; | 20 | }; |
24 | 21 | ||
22 | int setenforce_main(int argc, char **argv); | ||
25 | int setenforce_main(int argc, char **argv) | 23 | int setenforce_main(int argc, char **argv) |
26 | { | 24 | { |
27 | int i, rc; | 25 | int i, rc; |
@@ -34,7 +32,7 @@ int setenforce_main(int argc, char **argv) | |||
34 | for (i = 0; setenforce_cmd[i]; i++) { | 32 | for (i = 0; setenforce_cmd[i]; i++) { |
35 | if (strcasecmp(argv[1], setenforce_cmd[i]) != 0) | 33 | if (strcasecmp(argv[1], setenforce_cmd[i]) != 0) |
36 | continue; | 34 | continue; |
37 | rc = security_setenforce(setenforce_mode[i]); | 35 | rc = security_setenforce(i & 1); |
38 | if (rc < 0) | 36 | if (rc < 0) |
39 | bb_perror_msg_and_die("setenforce() failed"); | 37 | bb_perror_msg_and_die("setenforce() failed"); |
40 | return 0; | 38 | return 0; |