diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2017-08-06 12:23:04 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-08-06 12:23:04 +0200 |
commit | ae17ba0924c9c0020a6455020e7841a12bd738d4 (patch) | |
tree | ce67890203fef112b216d3492c75ae4197488bb0 /console-tools | |
parent | 32b60cc0db90e517399ca9fa73a8ac1140db810d (diff) | |
download | busybox-w32-ae17ba0924c9c0020a6455020e7841a12bd738d4.tar.gz busybox-w32-ae17ba0924c9c0020a6455020e7841a12bd738d4.tar.bz2 busybox-w32-ae17ba0924c9c0020a6455020e7841a12bd738d4.zip |
kbd_more: make it NOEXEC, remove redundant opt clearing
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'console-tools')
-rw-r--r-- | console-tools/kbd_mode.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/console-tools/kbd_mode.c b/console-tools/kbd_mode.c index b0b594614..f16449dcd 100644 --- a/console-tools/kbd_mode.c +++ b/console-tools/kbd_mode.c | |||
@@ -15,7 +15,7 @@ | |||
15 | //config: help | 15 | //config: help |
16 | //config: This program reports and sets keyboard mode. | 16 | //config: This program reports and sets keyboard mode. |
17 | 17 | ||
18 | //applet:IF_KBD_MODE(APPLET(kbd_mode, BB_DIR_BIN, BB_SUID_DROP)) | 18 | //applet:IF_KBD_MODE(APPLET_NOEXEC(kbd_mode, kbd_mode, BB_DIR_BIN, BB_SUID_DROP, kbd_mode)) |
19 | 19 | ||
20 | //kbuild:lib-$(CONFIG_KBD_MODE) += kbd_mode.o | 20 | //kbuild:lib-$(CONFIG_KBD_MODE) += kbd_mode.o |
21 | 21 | ||
@@ -27,7 +27,7 @@ | |||
27 | //usage: "\n -k Medium-raw (keycode)" | 27 | //usage: "\n -k Medium-raw (keycode)" |
28 | //usage: "\n -s Raw (scancode)" | 28 | //usage: "\n -s Raw (scancode)" |
29 | //usage: "\n -u Unicode (utf-8)" | 29 | //usage: "\n -u Unicode (utf-8)" |
30 | //usage: "\n -C TTY Affect TTY instead of /dev/tty" | 30 | //usage: "\n -C TTY Affect TTY" |
31 | 31 | ||
32 | #include "libbb.h" | 32 | #include "libbb.h" |
33 | #include <linux/kd.h> | 33 | #include <linux/kd.h> |
@@ -84,7 +84,6 @@ int kbd_mode_main(int argc UNUSED_PARAM, char **argv) | |||
84 | * #define K_OFF 0x04 | 84 | * #define K_OFF 0x04 |
85 | * (looks like "-ak" together would cause the same effect as -u) | 85 | * (looks like "-ak" together would cause the same effect as -u) |
86 | */ | 86 | */ |
87 | opt &= 0xf; /* clear -C bit */ | ||
88 | opt = opt & UNICODE ? 3 : opt >> 1; | 87 | opt = opt & UNICODE ? 3 : opt >> 1; |
89 | /* double cast prevents warnings about widening conversion */ | 88 | /* double cast prevents warnings about widening conversion */ |
90 | xioctl(fd, KDSKBMODE, (void*)(ptrdiff_t)opt); | 89 | xioctl(fd, KDSKBMODE, (void*)(ptrdiff_t)opt); |