From 4664989807211f088a473c29251aed04fe7afba0 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 7 Nov 2024 15:07:18 +0100 Subject: [PATCH] ask-password: add comment with well-known errors from ask_password_auto() --- src/shared/ask-password-api.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/shared/ask-password-api.c b/src/shared/ask-password-api.c index 502b22ee89e..9afb760e007 100644 --- a/src/shared/ask-password-api.c +++ b/src/shared/ask-password-api.c @@ -1165,6 +1165,17 @@ int ask_password_auto( assert(ret); + /* Returns the following well-known errors: + * + * -ETIME → a timeout was specified and hit + * -EUNATCH → no couldn't ask interactively and no cached password available either + * -ENOENT → the specified flag file disappeared + * -ECANCELED → the user explicitly cancelled the request + * -EINTR → SIGINT/SIGTERM where received during the query + * -ENOEXEC → headless mode was requested but no password could be acquired non-interactively + * -ECONNRESET → a POLLHUP has been seen on the specified hup_fd + */ + if (!FLAGS_SET(flags, ASK_PASSWORD_NO_CREDENTIAL) && req && req->credential) { r = ask_password_credential(req, flags, ret); if (r != -ENOKEY)