mirror of
https://github.com/sheumann/hush.git
synced 2024-12-27 01:32:08 +00:00
dumpkmap,loadkmap: abort if there are params on cmdline
function old new delta loadkmap_main 201 219 +18 dumpkmap_main 208 223 +15 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
f2da16f451
commit
2fd45c2cdb
@ -24,12 +24,17 @@ struct kbentry {
|
||||
#define MAX_NR_KEYMAPS 256
|
||||
|
||||
int dumpkmap_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int dumpkmap_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
|
||||
int dumpkmap_main(int argc UNUSED_PARAM, char **argv)
|
||||
{
|
||||
struct kbentry ke;
|
||||
int i, j, fd;
|
||||
RESERVE_CONFIG_BUFFER(flags, MAX_NR_KEYMAPS);
|
||||
|
||||
/* When user accidentally runs "dumpkmap FILE"
|
||||
* instead of "dumpkmap >FILE", we'd dump binary stuff to tty.
|
||||
* Let's prevent it: */
|
||||
if (argv[1])
|
||||
bb_show_usage();
|
||||
/* bb_warn_ignoring_args(argv[1]);*/
|
||||
|
||||
fd = get_console_fd_or_die();
|
||||
|
@ -32,6 +32,11 @@ int loadkmap_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
|
||||
/* const char *tty_name = CURRENT_TTY; */
|
||||
RESERVE_CONFIG_BUFFER(flags, MAX_NR_KEYMAPS);
|
||||
|
||||
/* When user accidentally runs "loadkmap FILE"
|
||||
* instead of "loadkmap <FILE", we end up waiting for input from tty.
|
||||
* Let's prevent it: */
|
||||
if (argv[1])
|
||||
bb_show_usage();
|
||||
/* bb_warn_ignoring_args(argv[1]); */
|
||||
fd = get_console_fd_or_die();
|
||||
/* or maybe:
|
||||
|
Loading…
Reference in New Issue
Block a user