From efeb864cb547a2cbf96dc0053a8bdb4d9190b364 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 05:50:45 +0200 Subject: Merging upstream version 256. Signed-off-by: Daniel Baumann --- src/ask-password/ask-password.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'src/ask-password') 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"); -- cgit v1.2.3