From: Ahmad Fatoum <a.fatoum@barebox.org>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@barebox.org>
Subject: [PATCH 5/5] commands: move login/passwd into security section
Date: Wed, 6 Aug 2025 16:00:05 +0200 [thread overview]
Message-ID: <20250806140005.2866622-5-a.fatoum@barebox.org> (raw)
In-Reply-To: <20250806140005.2866622-1-a.fatoum@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.fatoum@barebox.org>
---
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
next prev parent reply other threads:[~2025-08-06 14:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-06 14:00 [PATCH 1/5] security: add new top-level menu Ahmad Fatoum
2025-08-06 14:00 ` [PATCH 2/5] security: mark weaker passwords hashing algorithms insecure Ahmad Fatoum
2025-08-06 14:00 ` [PATCH 3/5] commands: introduce new security command group Ahmad Fatoum
2025-08-06 14:00 ` [PATCH 4/5] security: password: make PBKDF2 the default instead of MD5 Ahmad Fatoum
2025-08-06 14:00 ` Ahmad Fatoum [this message]
2025-08-07 6:26 ` [PATCH] fixup! security: add new top-level menu Ahmad Fatoum
2025-08-07 7:34 ` [PATCH 1/5] " Sascha Hauer
2025-08-07 8:11 ` Ahmad Fatoum
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250806140005.2866622-5-a.fatoum@barebox.org \
--to=a.fatoum@barebox.org \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox