ask-password-api: add new "hup_fd" field to AskPasswordReq

This new field allows specification of an fd on which the password
prompt logic will look for POLLHUP events for, and if seen will abort
the query.

The usecase for this is that when we query for a pw on behalf of a
Varlink client we can abort the query automatically if the client dies.
This commit is contained in:
Lennart Poettering
2025-01-02 16:38:44 +01:00
parent c4a02a526d
commit d66894a7a5
21 changed files with 96 additions and 14 deletions
+2
View File
@@ -913,6 +913,7 @@ static int get_password(
.keyring = "cryptsetup",
.credential = "cryptsetup.passphrase",
.until = until,
.hup_fd = -EBADF,
};
if (ignore_cached)
@@ -1430,6 +1431,7 @@ static int crypt_activate_by_token_pin_ask_password(
.keyring = keyring,
.credential = credential,
.until = until,
.hup_fd = -EBADF,
};
r = ask_password_auto(&req, flags, &pins);