ask-password-api: move timeout into AskPasswordRequest structure too

This commit is contained in:
Lennart Poettering
2025-01-02 16:38:25 +01:00
parent 72068d9d25
commit c4a02a526d
22 changed files with 62 additions and 44 deletions
+3 -2
View File
@@ -737,9 +737,10 @@ static int prompt_root_password(int rfd) {
AskPasswordRequest req = {
.tty_fd = -EBADF,
.message = msg1,
.until = USEC_INFINITY,
};
r = ask_password_tty(&req, /* until= */ 0, /* flags= */ 0, &a);
r = ask_password_tty(&req, /* flags= */ 0, &a);
if (r < 0)
return log_error_errno(r, "Failed to query root password: %m");
if (strv_length(a) != 1)
@@ -761,7 +762,7 @@ static int prompt_root_password(int rfd) {
req.message = msg2;
r = ask_password_tty(&req, /* until= */ 0, /* flags= */ 0, &b);
r = ask_password_tty(&req, /* flags= */ 0, &b);
if (r < 0)
return log_error_errno(r, "Failed to query root password: %m");
if (strv_length(b) != 1)