From: Lennart Poettering Date: Thu, 7 Nov 2024 14:07:18 +0000 (+0100) Subject: ask-password: add comment with well-known errors from ask_password_auto() X-Git-Tag: v258-rc1~1751^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7fd0ea6cf6b3f1ed407bba9b94cd9c1400e736b9;p=thirdparty%2Fsystemd.git ask-password: add comment with well-known errors from ask_password_auto() --- diff --git a/src/shared/ask-password-api.c b/src/shared/ask-password-api.c index 502b22ee89e..df8915082b3 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 → 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)