diff options
author | Xiang Fan <sfanxiang@gmail.com> | 2018-10-24 18:34:04 +0800 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-10-31 18:26:58 +0100 |
commit | c7b7d74e81bae65ffef38f46dd6abf0b8a9c3d4f (patch) | |
tree | 2e99111cfda17bbfcd6f213871cc3a33adfbd81d /src/shared/ask-password-api.h | |
parent | 45313bd9211d456b8e27486ab9032572ce6743bd (diff) | |
download | systemd-c7b7d74e81bae65ffef38f46dd6abf0b8a9c3d4f.tar.gz systemd-c7b7d74e81bae65ffef38f46dd6abf0b8a9c3d4f.tar.bz2 systemd-c7b7d74e81bae65ffef38f46dd6abf0b8a9c3d4f.zip |
ask-password: check keyring in ask_password_tty and ask_password_agent
A race condition happens when calling ask_password_auto() multiple times
to unlock several disks on boot and effectively no password caching is
utilized. This patch fixes it by polling the cache when waiting for
the password.
Diffstat (limited to 'src/shared/ask-password-api.h')
-rw-r--r-- | src/shared/ask-password-api.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/shared/ask-password-api.h b/src/shared/ask-password-api.h index 93ca8bff52..2d84ba6b04 100644 --- a/src/shared/ask-password-api.h +++ b/src/shared/ask-password-api.h @@ -15,7 +15,7 @@ typedef enum AskPasswordFlags { ASK_PASSWORD_CONSOLE_COLOR = 1 << 6, /* Use color if /dev/console points to a console that supports color */ } AskPasswordFlags; -int ask_password_tty(int tty_fd, const char *message, const char *keyname, usec_t until, AskPasswordFlags flags, const char *flag_file, char **ret); +int ask_password_tty(int tty_fd, const char *message, const char *keyname, usec_t until, AskPasswordFlags flags, const char *flag_file, char ***ret); int ask_password_agent(const char *message, const char *icon, const char *id, const char *keyname, usec_t until, AskPasswordFlags flag, char ***ret); int ask_password_keyring(const char *keyname, AskPasswordFlags flags, char ***ret); int ask_password_auto(const char *message, const char *icon, const char *id, const char *keyname, usec_t until, AskPasswordFlags flag, char ***ret); |