aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2017-08-06 18:17:58 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2017-08-06 18:17:58 +0200
commit341ce0a31eb2bdc352ef61df1954983c5235c818 (patch)
tree02c8618e4ca9cd1f7b61333b5f73be3b70bde08f
parent97b738d359c0398942d0dc4301415a2fe814eace (diff)
downloadbusybox-w32-341ce0a31eb2bdc352ef61df1954983c5235c818.tar.gz
busybox-w32-341ce0a31eb2bdc352ef61df1954983c5235c818.tar.bz2
busybox-w32-341ce0a31eb2bdc352ef61df1954983c5235c818.zip
setlogcons: make it NOEXEC, better --help text
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--NOFORK_NOEXEC.lst2
-rw-r--r--console-tools/setlogcons.c20
2 files changed, 17 insertions, 5 deletions
diff --git a/NOFORK_NOEXEC.lst b/NOFORK_NOEXEC.lst
index 30690af61..8145e2597 100644
--- a/NOFORK_NOEXEC.lst
+++ b/NOFORK_NOEXEC.lst
@@ -308,7 +308,7 @@ setarch - noexec. spawner
308setconsole 308setconsole
309setfont 309setfont
310setkeycodes 310setkeycodes
311setlogcons 311setlogcons - noexec
312setpriv - spawner, changes state, let's play safe and not be noexec 312setpriv - spawner, changes state, let's play safe and not be noexec
313setserial - noexec 313setserial - noexec
314setsid - spawner, uses fork_or_rexec() [not audited to work in noexec], let's play safe and not be noexec 314setsid - spawner, uses fork_or_rexec() [not audited to work in noexec], let's play safe and not be noexec
diff --git a/console-tools/setlogcons.c b/console-tools/setlogcons.c
index 1b5814eee..6778a4d2b 100644
--- a/console-tools/setlogcons.c
+++ b/console-tools/setlogcons.c
@@ -15,14 +15,26 @@
15//config: help 15//config: help
16//config: This program redirects the output console of kernel messages. 16//config: This program redirects the output console of kernel messages.
17 17
18//applet:IF_SETLOGCONS(APPLET(setlogcons, BB_DIR_USR_SBIN, BB_SUID_DROP)) 18//applet:IF_SETLOGCONS(APPLET_NOEXEC(setlogcons, setlogcons, BB_DIR_USR_SBIN, BB_SUID_DROP, setlogcons))
19 19
20//kbuild:lib-$(CONFIG_SETLOGCONS) += setlogcons.o 20//kbuild:lib-$(CONFIG_SETLOGCONS) += setlogcons.o
21 21
22//usage:#define setlogcons_trivial_usage 22//usage:#define setlogcons_trivial_usage
23//usage: "[N]" 23//usage: "[N]"
24//usage:#define setlogcons_full_usage "\n\n" 24//usage:#define setlogcons_full_usage "\n\n"
25//usage: "Redirect the kernel output to console N. Default:0 (current console)" 25//usage: "Pin kernel output to VT console N. Default:0 (do not pin)"
26
27// Comment from kernel source:
28/* ...
29 * By default, the kernel messages are always printed on the current virtual
30 * console. However, the user may modify that default with the
31 * TIOCL_SETKMSGREDIRECT ioctl call.
32 *
33 * This function sets the kernel message console to be @new. It returns the old
34 * virtual console number. The virtual terminal number 0 (both as parameter and
35 * return value) means no redirection (i.e. always printed on the currently
36 * active console).
37 */
26 38
27#include "libbb.h" 39#include "libbb.h"
28 40
@@ -33,8 +45,8 @@ int setlogcons_main(int argc UNUSED_PARAM, char **argv)
33 char fn; 45 char fn;
34 char subarg; 46 char subarg;
35 } arg = { 47 } arg = {
36 11, /* redirect kernel messages */ 48 11, /* redirect kernel messages (TIOCL_SETKMSGREDIRECT) */
37 0 /* to specified console (current as default) */ 49 0
38 }; 50 };
39 51
40 if (argv[1]) 52 if (argv[1])