aboutsummaryrefslogtreecommitdiff
path: root/miscutils
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 /miscutils
parent08e66a81495274dbe8a16f264761ccdf921b6564 (diff)
downloadbusybox-w32-97b738d359c0398942d0dc4301415a2fe814eace.tar.gz
busybox-w32-97b738d359c0398942d0dc4301415a2fe814eace.tar.bz2
busybox-w32-97b738d359c0398942d0dc4301415a2fe814eace.zip
setserial: make it NOEXEC
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'miscutils')
-rw-r--r--miscutils/setserial.c7
1 files changed, 4 insertions, 3 deletions
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 @@
15//config: help 15//config: help
16//config: Retrieve or set Linux serial port. 16//config: Retrieve or set Linux serial port.
17 17
18//applet:IF_SETSERIAL(APPLET(setserial, BB_DIR_BIN, BB_SUID_DROP)) 18//applet:IF_SETSERIAL(APPLET_NOEXEC(setserial, setserial, BB_DIR_BIN, BB_SUID_DROP, setserial))
19 19
20//kbuild:lib-$(CONFIG_SETSERIAL) += setserial.o 20//kbuild:lib-$(CONFIG_SETSERIAL) += setserial.o
21 21
@@ -746,14 +746,15 @@ int setserial_main(int argc UNUSED_PARAM, char **argv)
746 opts = getopt32(argv, "bGavzgq"); 746 opts = getopt32(argv, "bGavzgq");
747 argv += optind; 747 argv += optind;
748 748
749 if (!argv[1]) /* one arg only? */ 749 if (!argv[1]) /* one arg only? (nothing to change?) */
750 opts |= OPT_LIST_OF_DEVS; 750 opts |= OPT_LIST_OF_DEVS; /* force display */
751 751
752 if (!(opts & OPT_LIST_OF_DEVS)) { 752 if (!(opts & OPT_LIST_OF_DEVS)) {
753 serial_set(argv, opts); 753 serial_set(argv, opts);
754 argv[1] = NULL; 754 argv[1] = NULL;
755 } 755 }
756 756
757 /* -v effect: "after setting params, do not be silent, show them" */
757 if (opts & (OPT_VERBOSE | OPT_LIST_OF_DEVS)) { 758 if (opts & (OPT_VERBOSE | OPT_LIST_OF_DEVS)) {
758 do { 759 do {
759 serial_get(*argv, opts & OPT_MODE_MASK); 760 serial_get(*argv, opts & OPT_MODE_MASK);