From: Ahmad Fatoum <a.fat...@barebox.org> These fit thematically better to the security commands instead of the console commands they are currently grouped with.
Signed-off-by: Ahmad Fatoum <a.fat...@barebox.org> --- v1 -> v2: - unchanged --- commands/Kconfig | 97 ++++++++++++++++++++++++----------------------- commands/login.c | 2 +- commands/passwd.c | 2 +- 3 files changed, 51 insertions(+), 50 deletions(-) diff --git a/commands/Kconfig b/commands/Kconfig index 6c61bff1cd12..16b995cb3b7c 100644 --- a/commands/Kconfig +++ b/commands/Kconfig @@ -1535,23 +1535,6 @@ config CMD_EDIT Use cursor keys, Ctrl-C to exit and Ctrl-D to exit-with-save. -config CMD_LOGIN - tristate - select PASSWORD - depends on !CONSOLE_NONE - prompt "login" - help - Ask for a password - - Usage: login [-t TIMEOUT] COMMAND - - Asks for a password from the console before script execution continues. - The password can be set with the 'passwd' command. Instead of specifying - a TIMEOUT the magic variable 'global.login.timeout' could be set. - - Options: - -t TIMEOUT Execute COMMAND if no login withing TIMEOUT seconds - config CMD_MENU tristate depends on MENU @@ -1645,37 +1628,6 @@ config CMD_MENUTREE Options: -m DIR directory where the menu starts (Default: /env/menu) -config CMD_PASSWD - tristate - depends on CMD_LOGIN - prompt "passwd" - help - Set password - - Interactively asks for a password. The digest of this password will be - stored in /env/etc/passwd. This is then used by the 'login' command. - - Passwords can be generated on the host machine using barebox sandbox. - - Entering an empty string will disable the password function. - -if CMD_LOGIN || CMD_PASSWD - -choice - prompt "passwd mode" - -config PASSWD_MODE_HIDE - bool "Hide" - -config PASSWD_MODE_STAR - bool "Star" - -config PASSWD_MODE_CLEAR - bool "Clear" - -endchoice - -endif config CMD_SPLASH bool select IMAGE_RENDERER @@ -2354,6 +2306,55 @@ config CMD_KEYSTORE help keystore provides access to the barebox keystore. +config CMD_LOGIN + tristate + select PASSWORD + depends on !CONSOLE_NONE + prompt "login" + help + Ask for a password + + Usage: login [-t TIMEOUT] COMMAND + + Asks for a password from the console before script execution continues. + The password can be set with the 'passwd' command. Instead of specifying + a TIMEOUT the magic variable 'global.login.timeout' could be set. + + Options: + -t TIMEOUT Execute COMMAND if no login withing TIMEOUT seconds + +config CMD_PASSWD + tristate + depends on CMD_LOGIN + prompt "passwd" + help + Set password + + Interactively asks for a password. The digest of this password will be + stored in /env/etc/passwd. This is then used by the 'login' command. + + Passwords can be generated on the host machine using barebox sandbox. + + Entering an empty string will disable the password function. + +if CMD_LOGIN || CMD_PASSWD + +choice + prompt "passwd mode" + +config PASSWD_MODE_HIDE + bool "Hide" + +config PASSWD_MODE_STAR + bool "Star" + +config PASSWD_MODE_CLEAR + bool "Clear" + +endchoice + +endif + # end Security commands endmenu diff --git a/commands/login.c b/commands/login.c index 7085f3885cf9..a78b729d5483 100644 --- a/commands/login.c +++ b/commands/login.c @@ -21,7 +21,7 @@ BAREBOX_CMD_HELP_END BAREBOX_CMD_START(login) .cmd = do_login, BAREBOX_CMD_DESC("ask for a password") - BAREBOX_CMD_GROUP(CMD_GRP_CONSOLE) + BAREBOX_CMD_GROUP(CMD_GRP_SECURITY) BAREBOX_CMD_HELP(cmd_login_help) BAREBOX_CMD_COMPLETE(empty_complete) BAREBOX_CMD_END diff --git a/commands/passwd.c b/commands/passwd.c index dfcc63623a7f..5d3435f8cc4e 100644 --- a/commands/passwd.c +++ b/commands/passwd.c @@ -79,7 +79,7 @@ BAREBOX_CMD_HELP_END BAREBOX_CMD_START(passwd) .cmd = do_passwd, BAREBOX_CMD_DESC("set password") - BAREBOX_CMD_GROUP(CMD_GRP_CONSOLE) + BAREBOX_CMD_GROUP(CMD_GRP_SECURITY) BAREBOX_CMD_HELP(cmd_passwd_help) BAREBOX_CMD_COMPLETE(empty_complete) BAREBOX_CMD_END -- 2.39.5