aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2017-08-06 18:06:46 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2017-08-06 18:06:46 +0200
commit97b738d359c0398942d0dc4301415a2fe814eace (patch)
tree8902608e7ed41f3cb52499aee4929f8735db66c1
parent08e66a81495274dbe8a16f264761ccdf921b6564 (diff)
downloadbusybox-97b738d359c0398942d0dc4301415a2fe814eace.tar.gz
setserial: make it NOEXEC
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--NOFORK_NOEXEC.lst2
-rw-r--r--miscutils/setserial.c7
2 files changed, 5 insertions, 4 deletions
diff --git a/NOFORK_NOEXEC.lst b/NOFORK_NOEXEC.lst
index 3bd82aa60..30690af61 100644
--- a/NOFORK_NOEXEC.lst
+++ b/NOFORK_NOEXEC.lst
@@ -310,7 +310,7 @@ setfont
setkeycodes
setlogcons
setpriv - spawner, changes state, let's play safe and not be noexec
-setserial
+setserial - noexec
setsid - spawner, uses fork_or_rexec() [not audited to work in noexec], let's play safe and not be noexec
setuidgid - noexec. spawner
sha1sum - noexec. runner
diff --git a/miscutils/setserial.c b/miscutils/setserial.c
index a4d59f898..2000de7b1 100644
--- a/miscutils/setserial.c
+++ b/miscutils/setserial.c
@@ -15,7 +15,7 @@
//config: help
//config: Retrieve or set Linux serial port.
-//applet:IF_SETSERIAL(APPLET(setserial, BB_DIR_BIN, BB_SUID_DROP))
+//applet:IF_SETSERIAL(APPLET_NOEXEC(setserial, setserial, BB_DIR_BIN, BB_SUID_DROP, setserial))
//kbuild:lib-$(CONFIG_SETSERIAL) += setserial.o
@@ -746,14 +746,15 @@ int setserial_main(int argc UNUSED_PARAM, char **argv)
opts = getopt32(argv, "bGavzgq");
argv += optind;
- if (!argv[1]) /* one arg only? */
- opts |= OPT_LIST_OF_DEVS;
+ if (!argv[1]) /* one arg only? (nothing to change?) */
+ opts |= OPT_LIST_OF_DEVS; /* force display */
if (!(opts & OPT_LIST_OF_DEVS)) {
serial_set(argv, opts);
argv[1] = NULL;
}
+ /* -v effect: "after setting params, do not be silent, show them" */
if (opts & (OPT_VERBOSE | OPT_LIST_OF_DEVS)) {
do {
serial_get(*argv, opts & OPT_MODE_MASK);