diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-03-17 09:19:26 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-03-17 09:19:26 +0000 |
commit | 592d4fe7722b094b18194cdf6a692a71a116e4ca (patch) | |
tree | b8a85f1bf16d7e791fe65e1231fe24eb70501162 | |
parent | 4866e905d7e1f11d86374fad4e46aa2bd669c2ba (diff) | |
download | busybox-w32-592d4fe7722b094b18194cdf6a692a71a116e4ca.tar.gz busybox-w32-592d4fe7722b094b18194cdf6a692a71a116e4ca.tar.bz2 busybox-w32-592d4fe7722b094b18194cdf6a692a71a116e4ca.zip |
selinux/*: -Wunused-parameter fixes
runsv: make it NOMMU-capable
function old new delta
startservice 291 313 +22
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/0 up/down: 22/0) Total: 22 bytes
-rw-r--r-- | TODO_config_nommu | 48 | ||||
-rw-r--r-- | runit/runsv.c | 13 | ||||
-rw-r--r-- | selinux/chcon.c | 8 | ||||
-rw-r--r-- | selinux/getenforce.c | 2 | ||||
-rw-r--r-- | selinux/load_policy.c | 2 | ||||
-rw-r--r-- | selinux/matchpathcon.c | 2 | ||||
-rw-r--r-- | selinux/runcon.c | 2 | ||||
-rw-r--r-- | selinux/selinuxenabled.c | 2 | ||||
-rw-r--r-- | selinux/sestatus.c | 2 | ||||
-rw-r--r-- | selinux/setfiles.c | 9 |
10 files changed, 52 insertions, 38 deletions
diff --git a/TODO_config_nommu b/TODO_config_nommu index 03111c1a3..29c7580e3 100644 --- a/TODO_config_nommu +++ b/TODO_config_nommu | |||
@@ -1,7 +1,7 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Busybox version: 1.10.0.svn | 3 | # Busybox version: 1.10.0.svn |
4 | # Sat Mar 15 20:36:24 2008 | 4 | # Sat Mar 15 22:51:03 2008 |
5 | # | 5 | # |
6 | CONFIG_HAVE_DOT_CONFIG=y | 6 | CONFIG_HAVE_DOT_CONFIG=y |
7 | 7 | ||
@@ -29,7 +29,7 @@ CONFIG_FEATURE_PIDFILE=y | |||
29 | CONFIG_FEATURE_SUID=y | 29 | CONFIG_FEATURE_SUID=y |
30 | CONFIG_FEATURE_SUID_CONFIG=y | 30 | CONFIG_FEATURE_SUID_CONFIG=y |
31 | CONFIG_FEATURE_SUID_CONFIG_QUIET=y | 31 | CONFIG_FEATURE_SUID_CONFIG_QUIET=y |
32 | # CONFIG_SELINUX is not set | 32 | CONFIG_SELINUX=y |
33 | CONFIG_FEATURE_PREFER_APPLETS=y | 33 | CONFIG_FEATURE_PREFER_APPLETS=y |
34 | CONFIG_BUSYBOX_EXEC_PATH="/proc/self/exe" | 34 | CONFIG_BUSYBOX_EXEC_PATH="/proc/self/exe" |
35 | CONFIG_FEATURE_SYSLOG=y | 35 | CONFIG_FEATURE_SYSLOG=y |
@@ -356,7 +356,7 @@ CONFIG_FEATURE_FIND_PRUNE=y | |||
356 | CONFIG_FEATURE_FIND_DELETE=y | 356 | CONFIG_FEATURE_FIND_DELETE=y |
357 | CONFIG_FEATURE_FIND_PATH=y | 357 | CONFIG_FEATURE_FIND_PATH=y |
358 | CONFIG_FEATURE_FIND_REGEX=y | 358 | CONFIG_FEATURE_FIND_REGEX=y |
359 | # CONFIG_FEATURE_FIND_CONTEXT is not set | 359 | CONFIG_FEATURE_FIND_CONTEXT=y |
360 | CONFIG_GREP=y | 360 | CONFIG_GREP=y |
361 | CONFIG_FEATURE_GREP_EGREP_ALIAS=y | 361 | CONFIG_FEATURE_GREP_EGREP_ALIAS=y |
362 | CONFIG_FEATURE_GREP_FGREP_ALIAS=y | 362 | CONFIG_FEATURE_GREP_FGREP_ALIAS=y |
@@ -474,8 +474,8 @@ CONFIG_MKFS_MINIX=y | |||
474 | CONFIG_FEATURE_MINIX2=y | 474 | CONFIG_FEATURE_MINIX2=y |
475 | CONFIG_GETOPT=y | 475 | CONFIG_GETOPT=y |
476 | CONFIG_HEXDUMP=y | 476 | CONFIG_HEXDUMP=y |
477 | CONFIG_HD=y | ||
478 | CONFIG_FEATURE_HEXDUMP_REVERSE=y | 477 | CONFIG_FEATURE_HEXDUMP_REVERSE=y |
478 | CONFIG_HD=y | ||
479 | CONFIG_HWCLOCK=y | 479 | CONFIG_HWCLOCK=y |
480 | CONFIG_FEATURE_HWCLOCK_LONG_OPTIONS=y | 480 | CONFIG_FEATURE_HWCLOCK_LONG_OPTIONS=y |
481 | CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS=y | 481 | CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS=y |
@@ -550,7 +550,7 @@ CONFIG_FEATURE_MOUNT_LOOP=y | |||
550 | # Miscellaneous Utilities | 550 | # Miscellaneous Utilities |
551 | # | 551 | # |
552 | CONFIG_ADJTIMEX=y | 552 | CONFIG_ADJTIMEX=y |
553 | # CONFIG_BBCONFIG is not set | 553 | CONFIG_BBCONFIG=y |
554 | CONFIG_CHAT=y | 554 | CONFIG_CHAT=y |
555 | CONFIG_FEATURE_CHAT_NOFAIL=y | 555 | CONFIG_FEATURE_CHAT_NOFAIL=y |
556 | CONFIG_FEATURE_CHAT_TTY_HIFI=y | 556 | CONFIG_FEATURE_CHAT_TTY_HIFI=y |
@@ -745,7 +745,7 @@ CONFIG_PKILL=y | |||
745 | CONFIG_PS=y | 745 | CONFIG_PS=y |
746 | CONFIG_FEATURE_PS_WIDE=y | 746 | CONFIG_FEATURE_PS_WIDE=y |
747 | CONFIG_FEATURE_PS_TIME=y | 747 | CONFIG_FEATURE_PS_TIME=y |
748 | # CONFIG_FEATURE_PS_UNUSUAL_SYSTEMS is not set | 748 | CONFIG_FEATURE_PS_UNUSUAL_SYSTEMS=y |
749 | CONFIG_RENICE=y | 749 | CONFIG_RENICE=y |
750 | CONFIG_BB_SYSCTL=y | 750 | CONFIG_BB_SYSCTL=y |
751 | CONFIG_TOP=y | 751 | CONFIG_TOP=y |
@@ -812,7 +812,7 @@ CONFIG_LOGGER=y | |||
812 | # | 812 | # |
813 | # Runit Utilities | 813 | # Runit Utilities |
814 | # | 814 | # |
815 | # CONFIG_RUNSV is not set | 815 | CONFIG_RUNSV=y |
816 | CONFIG_RUNSVDIR=y | 816 | CONFIG_RUNSVDIR=y |
817 | CONFIG_SV=y | 817 | CONFIG_SV=y |
818 | CONFIG_SVLOGD=y | 818 | CONFIG_SVLOGD=y |
@@ -821,21 +821,25 @@ CONFIG_SETUIDGID=y | |||
821 | CONFIG_ENVUIDGID=y | 821 | CONFIG_ENVUIDGID=y |
822 | CONFIG_ENVDIR=y | 822 | CONFIG_ENVDIR=y |
823 | CONFIG_SOFTLIMIT=y | 823 | CONFIG_SOFTLIMIT=y |
824 | # CONFIG_CHCON is not set | 824 | |
825 | # CONFIG_FEATURE_CHCON_LONG_OPTIONS is not set | 825 | # |
826 | # CONFIG_GETENFORCE is not set | 826 | # Selinux Utilities |
827 | # CONFIG_GETSEBOOL is not set | 827 | # |
828 | # CONFIG_LOAD_POLICY is not set | 828 | CONFIG_CHCON=y |
829 | # CONFIG_MATCHPATHCON is not set | 829 | CONFIG_FEATURE_CHCON_LONG_OPTIONS=y |
830 | # CONFIG_RESTORECON is not set | 830 | CONFIG_GETENFORCE=y |
831 | # CONFIG_RUNCON is not set | 831 | CONFIG_GETSEBOOL=y |
832 | # CONFIG_FEATURE_RUNCON_LONG_OPTIONS is not set | 832 | CONFIG_LOAD_POLICY=y |
833 | # CONFIG_SELINUXENABLED is not set | 833 | CONFIG_MATCHPATHCON=y |
834 | # CONFIG_SETENFORCE is not set | 834 | CONFIG_RESTORECON=y |
835 | # CONFIG_SETFILES is not set | 835 | CONFIG_RUNCON=y |
836 | # CONFIG_FEATURE_SETFILES_CHECK_OPTION is not set | 836 | CONFIG_FEATURE_RUNCON_LONG_OPTIONS=y |
837 | # CONFIG_SETSEBOOL is not set | 837 | CONFIG_SELINUXENABLED=y |
838 | # CONFIG_SESTATUS is not set | 838 | CONFIG_SETENFORCE=y |
839 | CONFIG_SETFILES=y | ||
840 | CONFIG_FEATURE_SETFILES_CHECK_OPTION=y | ||
841 | CONFIG_SETSEBOOL=y | ||
842 | CONFIG_SESTATUS=y | ||
839 | 843 | ||
840 | # | 844 | # |
841 | # Print Utilities | 845 | # Print Utilities |
diff --git a/runit/runsv.c b/runit/runsv.c index 0da03e6b3..2ab034af6 100644 --- a/runit/runsv.c +++ b/runit/runsv.c | |||
@@ -256,15 +256,16 @@ static unsigned custom(struct svdir *s, char c) | |||
256 | 256 | ||
257 | if (s->islog) return 0; | 257 | if (s->islog) return 0; |
258 | strcpy(a, "control/?"); | 258 | strcpy(a, "control/?"); |
259 | a[8] = c; | 259 | a[8] = c; /* replace '?' */ |
260 | if (stat(a, &st) == 0) { | 260 | if (stat(a, &st) == 0) { |
261 | if (st.st_mode & S_IXUSR) { | 261 | if (st.st_mode & S_IXUSR) { |
262 | pid = fork(); | 262 | pid = vfork(); |
263 | if (pid == -1) { | 263 | if (pid == -1) { |
264 | warn_cannot("fork for control/?"); | 264 | warn_cannot("vfork for control/?"); |
265 | return 0; | 265 | return 0; |
266 | } | 266 | } |
267 | if (!pid) { | 267 | if (!pid) { |
268 | /* child */ | ||
268 | if (haslog && dup2(logpipe.wr, 1) == -1) | 269 | if (haslog && dup2(logpipe.wr, 1) == -1) |
269 | warn_cannot("setup stdout for control/?"); | 270 | warn_cannot("setup stdout for control/?"); |
270 | prog[0] = a; | 271 | prog[0] = a; |
@@ -272,6 +273,7 @@ static unsigned custom(struct svdir *s, char c) | |||
272 | execv(a, prog); | 273 | execv(a, prog); |
273 | fatal_cannot("run control/?"); | 274 | fatal_cannot("run control/?"); |
274 | } | 275 | } |
276 | /* parent */ | ||
275 | while (safe_waitpid(pid, &w, 0) == -1) { | 277 | while (safe_waitpid(pid, &w, 0) == -1) { |
276 | warn_cannot("wait for child control/?"); | 278 | warn_cannot("wait for child control/?"); |
277 | return 0; | 279 | return 0; |
@@ -318,8 +320,8 @@ static void startservice(struct svdir *s) | |||
318 | 320 | ||
319 | if (s->pid != 0) | 321 | if (s->pid != 0) |
320 | stopservice(s); /* should never happen */ | 322 | stopservice(s); /* should never happen */ |
321 | while ((p = fork()) == -1) { | 323 | while ((p = vfork()) == -1) { |
322 | warn_cannot("fork, sleeping"); | 324 | warn_cannot("vfork, sleeping"); |
323 | sleep(5); | 325 | sleep(5); |
324 | } | 326 | } |
325 | if (p == 0) { | 327 | if (p == 0) { |
@@ -344,6 +346,7 @@ static void startservice(struct svdir *s) | |||
344 | execvp(*run, run); | 346 | execvp(*run, run); |
345 | fatal2_cannot(s->islog ? "start log/" : "start ", *run); | 347 | fatal2_cannot(s->islog ? "start log/" : "start ", *run); |
346 | } | 348 | } |
349 | /* parent */ | ||
347 | if (s->state != S_FINISH) { | 350 | if (s->state != S_FINISH) { |
348 | gettimeofday_ns(&s->start); | 351 | gettimeofday_ns(&s->start); |
349 | s->state = S_RUN; | 352 | s->state = S_RUN; |
diff --git a/selinux/chcon.c b/selinux/chcon.c index f00e24278..288e93ad3 100644 --- a/selinux/chcon.c +++ b/selinux/chcon.c | |||
@@ -28,7 +28,11 @@ static char *type = NULL; | |||
28 | static char *range = NULL; | 28 | static char *range = NULL; |
29 | static char *specified_context = NULL; | 29 | static char *specified_context = NULL; |
30 | 30 | ||
31 | static int change_filedir_context(const char *fname, struct stat *stbuf, void *userData, int depth) | 31 | static int change_filedir_context( |
32 | const char *fname, | ||
33 | struct stat *stbuf ATTRIBUTE_UNUSED, | ||
34 | void *userData ATTRIBUTE_UNUSED, | ||
35 | int depth ATTRIBUTE_UNUSED) | ||
32 | { | 36 | { |
33 | context_t context = NULL; | 37 | context_t context = NULL; |
34 | security_context_t file_context = NULL; | 38 | security_context_t file_context = NULL; |
@@ -121,7 +125,7 @@ static const char chcon_longopts[] ALIGN1 = | |||
121 | #endif | 125 | #endif |
122 | 126 | ||
123 | int chcon_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 127 | int chcon_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
124 | int chcon_main(int argc, char **argv) | 128 | int chcon_main(int argc ATTRIBUTE_UNUSED, char **argv) |
125 | { | 129 | { |
126 | char *reference_file; | 130 | char *reference_file; |
127 | char *fname; | 131 | char *fname; |
diff --git a/selinux/getenforce.c b/selinux/getenforce.c index e11e78e31..a39ce6d2b 100644 --- a/selinux/getenforce.c +++ b/selinux/getenforce.c | |||
@@ -9,7 +9,7 @@ | |||
9 | #include "libbb.h" | 9 | #include "libbb.h" |
10 | 10 | ||
11 | int getenforce_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 11 | int getenforce_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
12 | int getenforce_main(int argc, char **argv) | 12 | int getenforce_main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) |
13 | { | 13 | { |
14 | int rc; | 14 | int rc; |
15 | 15 | ||
diff --git a/selinux/load_policy.c b/selinux/load_policy.c index f9aa49d19..c5b0e7a1b 100644 --- a/selinux/load_policy.c +++ b/selinux/load_policy.c | |||
@@ -5,7 +5,7 @@ | |||
5 | #include "libbb.h" | 5 | #include "libbb.h" |
6 | 6 | ||
7 | int load_policy_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 7 | int load_policy_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
8 | int load_policy_main(int argc, char **argv) | 8 | int load_policy_main(int argc, char **argv ATTRIBUTE_UNUSED) |
9 | { | 9 | { |
10 | int rc; | 10 | int rc; |
11 | 11 | ||
diff --git a/selinux/matchpathcon.c b/selinux/matchpathcon.c index 6de68bceb..e0b374add 100644 --- a/selinux/matchpathcon.c +++ b/selinux/matchpathcon.c | |||
@@ -30,7 +30,7 @@ static int print_matchpathcon(char *path, int noprint) | |||
30 | #define OPT_VERIFY (1<<4) /* -V */ | 30 | #define OPT_VERIFY (1<<4) /* -V */ |
31 | 31 | ||
32 | int matchpathcon_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 32 | int matchpathcon_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
33 | int matchpathcon_main(int argc, char **argv) | 33 | int matchpathcon_main(int argc ATTRIBUTE_UNUSED, char **argv) |
34 | { | 34 | { |
35 | int error = 0; | 35 | int error = 0; |
36 | unsigned opts; | 36 | unsigned opts; |
diff --git a/selinux/runcon.c b/selinux/runcon.c index 89a4b0555..0f573d1ec 100644 --- a/selinux/runcon.c +++ b/selinux/runcon.c | |||
@@ -88,7 +88,7 @@ static const char runcon_longopts[] ALIGN1 = | |||
88 | #define OPTS_CONTEXT_COMPONENT (OPTS_ROLE | OPTS_TYPE | OPTS_USER | OPTS_RANGE) | 88 | #define OPTS_CONTEXT_COMPONENT (OPTS_ROLE | OPTS_TYPE | OPTS_USER | OPTS_RANGE) |
89 | 89 | ||
90 | int runcon_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 90 | int runcon_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
91 | int runcon_main(int argc, char **argv) | 91 | int runcon_main(int argc ATTRIBUTE_UNUSED, char **argv) |
92 | { | 92 | { |
93 | char *role = NULL; | 93 | char *role = NULL; |
94 | char *range = NULL; | 94 | char *range = NULL; |
diff --git a/selinux/selinuxenabled.c b/selinux/selinuxenabled.c index 114d2b6e2..c6e947ce5 100644 --- a/selinux/selinuxenabled.c +++ b/selinux/selinuxenabled.c | |||
@@ -8,7 +8,7 @@ | |||
8 | #include "libbb.h" | 8 | #include "libbb.h" |
9 | 9 | ||
10 | int selinuxenabled_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 10 | int selinuxenabled_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
11 | int selinuxenabled_main(int argc, char **argv) | 11 | int selinuxenabled_main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) |
12 | { | 12 | { |
13 | return !is_selinux_enabled(); | 13 | return !is_selinux_enabled(); |
14 | } | 14 | } |
diff --git a/selinux/sestatus.c b/selinux/sestatus.c index cc17b175b..43e31d455 100644 --- a/selinux/sestatus.c +++ b/selinux/sestatus.c | |||
@@ -159,7 +159,7 @@ static void display_verbose(void) | |||
159 | } | 159 | } |
160 | 160 | ||
161 | int sestatus_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 161 | int sestatus_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
162 | int sestatus_main(int argc, char **argv) | 162 | int sestatus_main(int argc ATTRIBUTE_UNUSED, char **argv) |
163 | { | 163 | { |
164 | unsigned opts; | 164 | unsigned opts; |
165 | const char *pol_path; | 165 | const char *pol_path; |
diff --git a/selinux/setfiles.c b/selinux/setfiles.c index 905333f94..02bb9113f 100644 --- a/selinux/setfiles.c +++ b/selinux/setfiles.c | |||
@@ -99,7 +99,7 @@ enum { | |||
99 | #define FLAG_R (option_mask32 & OPT_R) | 99 | #define FLAG_R (option_mask32 & OPT_R) |
100 | 100 | ||
101 | 101 | ||
102 | static void qprintf(const char *fmt, ...) | 102 | static void qprintf(const char *fmt ATTRIBUTE_UNUSED, ...) |
103 | { | 103 | { |
104 | /* quiet, do nothing */ | 104 | /* quiet, do nothing */ |
105 | } | 105 | } |
@@ -391,8 +391,11 @@ static int restore(const char *file) | |||
391 | * This function is called by recursive_action on each file during | 391 | * This function is called by recursive_action on each file during |
392 | * the directory traversal. | 392 | * the directory traversal. |
393 | */ | 393 | */ |
394 | static int apply_spec(const char *file, | 394 | static int apply_spec( |
395 | struct stat *sb, void *userData, int depth) | 395 | const char *file, |
396 | struct stat *sb, | ||
397 | void *userData ATTRIBUTE_UNUSED, | ||
398 | int depth ATTRIBUTE_UNUSED) | ||
396 | { | 399 | { |
397 | if (!follow_mounts) { | 400 | if (!follow_mounts) { |
398 | /* setfiles does not process across different mount points */ | 401 | /* setfiles does not process across different mount points */ |