diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2017-08-06 18:29:25 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-08-06 18:29:25 +0200 |
commit | b83db4ddae4c88b8837cd721c0f74e83bf956a5e (patch) | |
tree | 4d7e5d3d29bd3211c9db68e62aad7c86d87f4b55 | |
parent | 341ce0a31eb2bdc352ef61df1954983c5235c818 (diff) | |
download | busybox-b83db4ddae4c88b8837cd721c0f74e83bf956a5e.tar.gz |
setkeycodes: make it NOEXEC, better --help text
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | NOFORK_NOEXEC.lst | 2 | ||||
-rw-r--r-- | console-tools/setkeycodes.c | 15 |
2 files changed, 9 insertions, 8 deletions
diff --git a/NOFORK_NOEXEC.lst b/NOFORK_NOEXEC.lst index 8145e2597..58b3e9c54 100644 --- a/NOFORK_NOEXEC.lst +++ b/NOFORK_NOEXEC.lst @@ -307,7 +307,7 @@ seq - noexec. runner setarch - noexec. spawner setconsole setfont -setkeycodes +setkeycodes - noexec setlogcons - noexec setpriv - spawner, changes state, let's play safe and not be noexec setserial - noexec diff --git a/console-tools/setkeycodes.c b/console-tools/setkeycodes.c index 543fbe3e0..1363ac9d1 100644 --- a/console-tools/setkeycodes.c +++ b/console-tools/setkeycodes.c @@ -16,17 +16,16 @@ //config: This program loads entries into the kernel's scancode-to-keycode //config: map, allowing unusual keyboards to generate usable keycodes. -//applet:IF_SETKEYCODES(APPLET(setkeycodes, BB_DIR_USR_BIN, BB_SUID_DROP)) +//applet:IF_SETKEYCODES(APPLET_NOEXEC(setkeycodes, setkeycodes, BB_DIR_USR_BIN, BB_SUID_DROP, setkeycodes)) //kbuild:lib-$(CONFIG_SETKEYCODES) += setkeycodes.o //usage:#define setkeycodes_trivial_usage -//usage: "SCANCODE KEYCODE..." +//usage: "{ SCANCODE KEYCODE }..." //usage:#define setkeycodes_full_usage "\n\n" -//usage: "Set entries into the kernel's scancode-to-keycode map,\n" +//usage: "Modify kernel's scancode-to-keycode map,\n" //usage: "allowing unusual keyboards to generate usable keycodes.\n\n" -//usage: "SCANCODE may be either xx or e0xx (hexadecimal),\n" -//usage: "and KEYCODE is given in decimal." +//usage: "SCANCODE is either xx or e0xx (hexadecimal), KEYCODE is decimal." //usage: //usage:#define setkeycodes_example_usage //usage: "$ setkeycodes e030 127\n" @@ -45,7 +44,6 @@ int setkeycodes_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int setkeycodes_main(int argc, char **argv) { int fd; - struct kbkeycode a; if (!(argc & 1) /* if even */ || argc < 2) { bb_show_usage(); @@ -54,7 +52,10 @@ int setkeycodes_main(int argc, char **argv) fd = get_console_fd_or_die(); while (argv[1]) { - int sc = xstrtoul_range(argv[1], 16, 0, 0xe07f); + struct kbkeycode a; + int sc; + + sc = xstrtoul_range(argv[1], 16, 0, 0xe07f); if (sc >= 0xe000) { sc -= 0xe000; sc += 0x0080; |