summaryrefslogtreecommitdiffstats
path: root/src/ask-password
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 03:50:42 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 03:50:42 +0000
commit78e9bb837c258ac0ec7712b3d612cc2f407e731e (patch)
treef515d16b6efd858a9aeb5b0ef5d6f90bf288283d /src/ask-password
parentAdding debian version 255.5-1. (diff)
downloadsystemd-78e9bb837c258ac0ec7712b3d612cc2f407e731e.tar.xz
systemd-78e9bb837c258ac0ec7712b3d612cc2f407e731e.zip
Merging upstream version 256.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/ask-password')
-rw-r--r--src/ask-password/ask-password.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/ask-password/ask-password.c b/src/ask-password/ask-password.c
index bf4c93e..b2c8ef7 100644
--- a/src/ask-password/ask-password.c
+++ b/src/ask-password/ask-password.c
@@ -226,20 +226,23 @@ static int run(int argc, char *argv[]) {
usec_t timeout;
int r;
- log_show_color(true);
- log_parse_environment();
- log_open();
+ log_setup();
r = parse_argv(argc, argv);
if (r <= 0)
return r;
- if (arg_timeout > 0)
- timeout = usec_add(now(CLOCK_MONOTONIC), arg_timeout);
- else
- timeout = 0;
+ timeout = arg_timeout > 0 ? usec_add(now(CLOCK_MONOTONIC), arg_timeout) : 0;
- r = ask_password_auto(arg_message, arg_icon, arg_id, arg_key_name, arg_credential_name ?: "password", timeout, arg_flags, &l);
+ AskPasswordRequest req = {
+ .message = arg_message,
+ .icon = arg_icon,
+ .id = arg_id,
+ .keyring = arg_key_name,
+ .credential = arg_credential_name ?: "password",
+ };
+
+ r = ask_password_auto(&req, timeout, arg_flags, &l);
if (r < 0)
return log_error_errno(r, "Failed to query password: %m");