ask-password-api: move tty_fd into AskPasswordRequest structure, too

This commit is contained in:
Lennart Poettering
2025-01-02 16:38:12 +01:00
parent 4ff3689ad2
commit 72068d9d25
21 changed files with 37 additions and 8 deletions
+3 -2
View File
@@ -735,10 +735,11 @@ static int prompt_root_password(int rfd) {
_cleanup_free_ char *error = NULL;
AskPasswordRequest req = {
.tty_fd = -EBADF,
.message = msg1,
};
r = ask_password_tty(-EBADF, &req, /* until= */ 0, /* flags= */ 0, &a);
r = ask_password_tty(&req, /* until= */ 0, /* flags= */ 0, &a);
if (r < 0)
return log_error_errno(r, "Failed to query root password: %m");
if (strv_length(a) != 1)
@@ -760,7 +761,7 @@ static int prompt_root_password(int rfd) {
req.message = msg2;
r = ask_password_tty(-EBADF, &req, /* until= */ 0, /* flags= */ 0, &b);
r = ask_password_tty(&req, /* until= */ 0, /* flags= */ 0, &b);
if (r < 0)
return log_error_errno(r, "Failed to query root password: %m");
if (strv_length(b) != 1)