diff options
| author | Ron Yorston <rmy@pobox.com> | 2015-10-19 12:53:35 +0100 |
|---|---|---|
| committer | Ron Yorston <rmy@pobox.com> | 2015-10-19 12:53:35 +0100 |
| commit | 8afe8ee83a274925340473fa4d0a984bdcbee740 (patch) | |
| tree | b78ed448cb6a55ba7d0ef8141a9f68b55b8acf11 /debianutils | |
| parent | caab029609633220c417dc0aaa9025fd4b7a169c (diff) | |
| parent | 3d0805e9e7c45e6c0f9fb5e587d8b4a5a5f3c74c (diff) | |
| download | busybox-w32-8afe8ee83a274925340473fa4d0a984bdcbee740.tar.gz busybox-w32-8afe8ee83a274925340473fa4d0a984bdcbee740.tar.bz2 busybox-w32-8afe8ee83a274925340473fa4d0a984bdcbee740.zip | |
Merge branch 'busybox' into merge
Diffstat (limited to 'debianutils')
| -rw-r--r-- | debianutils/Config.src | 75 | ||||
| -rw-r--r-- | debianutils/Kbuild.src | 5 | ||||
| -rw-r--r-- | debianutils/mktemp.c | 9 | ||||
| -rw-r--r-- | debianutils/pipe_progress.c | 9 | ||||
| -rw-r--r-- | debianutils/run_parts.c | 34 | ||||
| -rw-r--r-- | debianutils/start_stop_daemon.c | 36 | ||||
| -rw-r--r-- | debianutils/which.c | 10 |
7 files changed, 94 insertions, 84 deletions
diff --git a/debianutils/Config.src b/debianutils/Config.src index cbc09b5ce..61daeb047 100644 --- a/debianutils/Config.src +++ b/debianutils/Config.src | |||
| @@ -7,79 +7,4 @@ menu "Debian Utilities" | |||
| 7 | 7 | ||
| 8 | INSERT | 8 | INSERT |
| 9 | 9 | ||
| 10 | config MKTEMP | ||
| 11 | bool "mktemp" | ||
| 12 | default y | ||
| 13 | help | ||
| 14 | mktemp is used to create unique temporary files | ||
| 15 | |||
| 16 | config PIPE_PROGRESS | ||
| 17 | bool "pipe_progress" | ||
| 18 | default y | ||
| 19 | help | ||
| 20 | Display a dot to indicate pipe activity. | ||
| 21 | |||
| 22 | config RUN_PARTS | ||
| 23 | bool "run-parts" | ||
| 24 | default y | ||
| 25 | help | ||
| 26 | run-parts is a utility designed to run all the scripts in a directory. | ||
| 27 | |||
| 28 | It is useful to set up a directory like cron.daily, where you need to | ||
| 29 | execute all the scripts in that directory. | ||
| 30 | |||
| 31 | In this implementation of run-parts some features (such as report | ||
| 32 | mode) are not implemented. | ||
| 33 | |||
| 34 | Unless you know that run-parts is used in some of your scripts | ||
| 35 | you can safely say N here. | ||
| 36 | |||
| 37 | config FEATURE_RUN_PARTS_LONG_OPTIONS | ||
| 38 | bool "Enable long options" | ||
| 39 | default y | ||
| 40 | depends on RUN_PARTS && LONG_OPTS | ||
| 41 | help | ||
| 42 | Support long options for the run-parts applet. | ||
| 43 | |||
| 44 | config FEATURE_RUN_PARTS_FANCY | ||
| 45 | bool "Support additional arguments" | ||
| 46 | default y | ||
| 47 | depends on RUN_PARTS | ||
| 48 | help | ||
| 49 | Support additional options: | ||
| 50 | -l --list print the names of the all matching files (not | ||
| 51 | limited to executables), but don't actually run them. | ||
| 52 | |||
| 53 | config START_STOP_DAEMON | ||
| 54 | bool "start-stop-daemon" | ||
| 55 | default y | ||
| 56 | help | ||
| 57 | start-stop-daemon is used to control the creation and | ||
| 58 | termination of system-level processes, usually the ones | ||
| 59 | started during the startup of the system. | ||
| 60 | |||
| 61 | config FEATURE_START_STOP_DAEMON_FANCY | ||
| 62 | bool "Support additional arguments" | ||
| 63 | default y | ||
| 64 | depends on START_STOP_DAEMON | ||
| 65 | help | ||
| 66 | Support additional arguments. | ||
| 67 | -o|--oknodo ignored since we exit with 0 anyway | ||
| 68 | -v|--verbose | ||
| 69 | -N|--nicelevel N | ||
| 70 | |||
| 71 | config FEATURE_START_STOP_DAEMON_LONG_OPTIONS | ||
| 72 | bool "Enable long options" | ||
| 73 | default y | ||
| 74 | depends on START_STOP_DAEMON && LONG_OPTS | ||
| 75 | help | ||
| 76 | Support long options for the start-stop-daemon applet. | ||
| 77 | |||
| 78 | config WHICH | ||
| 79 | bool "which" | ||
| 80 | default y | ||
| 81 | help | ||
| 82 | which is used to find programs in your PATH and | ||
| 83 | print out their pathnames. | ||
| 84 | |||
| 85 | endmenu | 10 | endmenu |
diff --git a/debianutils/Kbuild.src b/debianutils/Kbuild.src index d41b5c8e4..6b4fb7470 100644 --- a/debianutils/Kbuild.src +++ b/debianutils/Kbuild.src | |||
| @@ -7,8 +7,3 @@ | |||
| 7 | lib-y:= | 7 | lib-y:= |
| 8 | 8 | ||
| 9 | INSERT | 9 | INSERT |
| 10 | lib-$(CONFIG_MKTEMP) += mktemp.o | ||
| 11 | lib-$(CONFIG_PIPE_PROGRESS) += pipe_progress.o | ||
| 12 | lib-$(CONFIG_RUN_PARTS) += run_parts.o | ||
| 13 | lib-$(CONFIG_START_STOP_DAEMON) += start_stop_daemon.o | ||
| 14 | lib-$(CONFIG_WHICH) += which.o | ||
diff --git a/debianutils/mktemp.c b/debianutils/mktemp.c index 983d7a246..65353697a 100644 --- a/debianutils/mktemp.c +++ b/debianutils/mktemp.c | |||
| @@ -30,6 +30,15 @@ | |||
| 30 | * a directory: $TMPDIR, if set; else the directory specified via | 30 | * a directory: $TMPDIR, if set; else the directory specified via |
| 31 | * -p; else /tmp [deprecated] | 31 | * -p; else /tmp [deprecated] |
| 32 | */ | 32 | */ |
| 33 | //config:config MKTEMP | ||
| 34 | //config: bool "mktemp" | ||
| 35 | //config: default y | ||
| 36 | //config: help | ||
| 37 | //config: mktemp is used to create unique temporary files | ||
| 38 | |||
| 39 | //applet:IF_MKTEMP(APPLET(mktemp, BB_DIR_BIN, BB_SUID_DROP)) | ||
| 40 | |||
| 41 | //kbuild:lib-$(CONFIG_MKTEMP) += mktemp.o | ||
| 33 | 42 | ||
| 34 | //usage:#define mktemp_trivial_usage | 43 | //usage:#define mktemp_trivial_usage |
| 35 | //usage: "[-dt] [-p DIR] [TEMPLATE]" | 44 | //usage: "[-dt] [-p DIR] [TEMPLATE]" |
diff --git a/debianutils/pipe_progress.c b/debianutils/pipe_progress.c index 2c7444f31..21d330b59 100644 --- a/debianutils/pipe_progress.c +++ b/debianutils/pipe_progress.c | |||
| @@ -6,6 +6,15 @@ | |||
| 6 | * | 6 | * |
| 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 8 | */ | 8 | */ |
| 9 | //config:config PIPE_PROGRESS | ||
| 10 | //config: bool "pipe_progress" | ||
| 11 | //config: default y | ||
| 12 | //config: help | ||
| 13 | //config: Display a dot to indicate pipe activity. | ||
| 14 | |||
| 15 | //applet:IF_PIPE_PROGRESS(APPLET(pipe_progress, BB_DIR_BIN, BB_SUID_DROP)) | ||
| 16 | |||
| 17 | //kbuild:lib-$(CONFIG_PIPE_PROGRESS) += pipe_progress.o | ||
| 9 | 18 | ||
| 10 | //usage:#define pipe_progress_trivial_usage NOUSAGE_STR | 19 | //usage:#define pipe_progress_trivial_usage NOUSAGE_STR |
| 11 | //usage:#define pipe_progress_full_usage "" | 20 | //usage:#define pipe_progress_full_usage "" |
diff --git a/debianutils/run_parts.c b/debianutils/run_parts.c index dd6fe7d49..13617c6e1 100644 --- a/debianutils/run_parts.c +++ b/debianutils/run_parts.c | |||
| @@ -22,6 +22,40 @@ | |||
| 22 | * report mode. As the original run-parts support only long options, I've | 22 | * report mode. As the original run-parts support only long options, I've |
| 23 | * broken compatibility because the BusyBox policy doesn't allow them. | 23 | * broken compatibility because the BusyBox policy doesn't allow them. |
| 24 | */ | 24 | */ |
| 25 | //config:config RUN_PARTS | ||
| 26 | //config: bool "run-parts" | ||
| 27 | //config: default y | ||
| 28 | //config: help | ||
| 29 | //config: run-parts is a utility designed to run all the scripts in a directory. | ||
| 30 | //config: | ||
| 31 | //config: It is useful to set up a directory like cron.daily, where you need to | ||
| 32 | //config: execute all the scripts in that directory. | ||
| 33 | //config: | ||
| 34 | //config: In this implementation of run-parts some features (such as report | ||
| 35 | //config: mode) are not implemented. | ||
| 36 | //config: | ||
| 37 | //config: Unless you know that run-parts is used in some of your scripts | ||
| 38 | //config: you can safely say N here. | ||
| 39 | //config: | ||
| 40 | //config:config FEATURE_RUN_PARTS_LONG_OPTIONS | ||
| 41 | //config: bool "Enable long options" | ||
| 42 | //config: default y | ||
| 43 | //config: depends on RUN_PARTS && LONG_OPTS | ||
| 44 | //config: help | ||
| 45 | //config: Support long options for the run-parts applet. | ||
| 46 | //config: | ||
| 47 | //config:config FEATURE_RUN_PARTS_FANCY | ||
| 48 | //config: bool "Support additional arguments" | ||
| 49 | //config: default y | ||
| 50 | //config: depends on RUN_PARTS | ||
| 51 | //config: help | ||
| 52 | //config: Support additional options: | ||
| 53 | //config: -l --list print the names of the all matching files (not | ||
| 54 | //config: limited to executables), but don't actually run them. | ||
| 55 | |||
| 56 | //applet:IF_RUN_PARTS(APPLET_ODDNAME(run-parts, run_parts, BB_DIR_BIN, BB_SUID_DROP, run_parts)) | ||
| 57 | |||
| 58 | //kbuild:lib-$(CONFIG_RUN_PARTS) += run_parts.o | ||
| 25 | 59 | ||
| 26 | //usage:#define run_parts_trivial_usage | 60 | //usage:#define run_parts_trivial_usage |
| 27 | //usage: "[-a ARG]... [-u UMASK] " | 61 | //usage: "[-a ARG]... [-u UMASK] " |
diff --git a/debianutils/start_stop_daemon.c b/debianutils/start_stop_daemon.c index 7dadc3c9e..d7c730f45 100644 --- a/debianutils/start_stop_daemon.c +++ b/debianutils/start_stop_daemon.c | |||
| @@ -56,6 +56,34 @@ Misc options: | |||
| 56 | -q,--quiet Quiet | 56 | -q,--quiet Quiet |
| 57 | -v,--verbose Verbose | 57 | -v,--verbose Verbose |
| 58 | */ | 58 | */ |
| 59 | //config:config START_STOP_DAEMON | ||
| 60 | //config: bool "start-stop-daemon" | ||
| 61 | //config: default y | ||
| 62 | //config: help | ||
| 63 | //config: start-stop-daemon is used to control the creation and | ||
| 64 | //config: termination of system-level processes, usually the ones | ||
| 65 | //config: started during the startup of the system. | ||
| 66 | //config: | ||
| 67 | //config:config FEATURE_START_STOP_DAEMON_FANCY | ||
| 68 | //config: bool "Support additional arguments" | ||
| 69 | //config: default y | ||
| 70 | //config: depends on START_STOP_DAEMON | ||
| 71 | //config: help | ||
| 72 | //config: Support additional arguments. | ||
| 73 | //config: -o|--oknodo ignored since we exit with 0 anyway | ||
| 74 | //config: -v|--verbose | ||
| 75 | //config: -N|--nicelevel N | ||
| 76 | //config: | ||
| 77 | //config:config FEATURE_START_STOP_DAEMON_LONG_OPTIONS | ||
| 78 | //config: bool "Enable long options" | ||
| 79 | //config: default y | ||
| 80 | //config: depends on START_STOP_DAEMON && LONG_OPTS | ||
| 81 | //config: help | ||
| 82 | //config: Support long options for the start-stop-daemon applet. | ||
| 83 | |||
| 84 | //applet:IF_START_STOP_DAEMON(APPLET_ODDNAME(start-stop-daemon, start_stop_daemon, BB_DIR_SBIN, BB_SUID_DROP, start_stop_daemon)) | ||
| 85 | |||
| 86 | //kbuild:lib-$(CONFIG_START_STOP_DAEMON) += start_stop_daemon.o | ||
| 59 | 87 | ||
| 60 | //usage:#define start_stop_daemon_trivial_usage | 88 | //usage:#define start_stop_daemon_trivial_usage |
| 61 | //usage: "[OPTIONS] [-S|-K] ... [-- ARGS...]" | 89 | //usage: "[OPTIONS] [-S|-K] ... [-- ARGS...]" |
| @@ -511,15 +539,15 @@ int start_stop_daemon_main(int argc UNUSED_PARAM, char **argv) | |||
| 511 | write_pidfile(pidfile); | 539 | write_pidfile(pidfile); |
| 512 | } | 540 | } |
| 513 | if (opt & OPT_c) { | 541 | if (opt & OPT_c) { |
| 514 | struct bb_uidgid_t ugid = { -1, -1 }; | 542 | struct bb_uidgid_t ugid; |
| 515 | parse_chown_usergroup_or_die(&ugid, chuid); | 543 | parse_chown_usergroup_or_die(&ugid, chuid); |
| 516 | if (ugid.uid != (uid_t) -1) { | 544 | if (ugid.uid != (uid_t) -1L) { |
| 517 | struct passwd *pw = xgetpwuid(ugid.uid); | 545 | struct passwd *pw = xgetpwuid(ugid.uid); |
| 518 | if (ugid.gid != (gid_t) -1) | 546 | if (ugid.gid != (gid_t) -1L) |
| 519 | pw->pw_gid = ugid.gid; | 547 | pw->pw_gid = ugid.gid; |
| 520 | /* initgroups, setgid, setuid: */ | 548 | /* initgroups, setgid, setuid: */ |
| 521 | change_identity(pw); | 549 | change_identity(pw); |
| 522 | } else if (ugid.gid != (gid_t) -1) { | 550 | } else if (ugid.gid != (gid_t) -1L) { |
| 523 | xsetgid(ugid.gid); | 551 | xsetgid(ugid.gid); |
| 524 | setgroups(1, &ugid.gid); | 552 | setgroups(1, &ugid.gid); |
| 525 | } | 553 | } |
diff --git a/debianutils/which.c b/debianutils/which.c index ace5b82dd..86dd5c352 100644 --- a/debianutils/which.c +++ b/debianutils/which.c | |||
| @@ -5,6 +5,16 @@ | |||
| 5 | * | 5 | * |
| 6 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 6 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 7 | */ | 7 | */ |
| 8 | //config:config WHICH | ||
| 9 | //config: bool "which" | ||
| 10 | //config: default y | ||
| 11 | //config: help | ||
| 12 | //config: which is used to find programs in your PATH and | ||
| 13 | //config: print out their pathnames. | ||
| 14 | |||
| 15 | //applet:IF_WHICH(APPLET(which, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
| 16 | |||
| 17 | //kbuild:lib-$(CONFIG_WHICH) += which.o | ||
| 8 | 18 | ||
| 9 | //usage:#define which_trivial_usage | 19 | //usage:#define which_trivial_usage |
| 10 | //usage: "[COMMAND]..." | 20 | //usage: "[COMMAND]..." |
