diff options
Diffstat (limited to 'src/ask-password-api.c')
-rw-r--r-- | src/ask-password-api.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ask-password-api.c b/src/ask-password-api.c index e4ee8adb4f..9f7023e328 100644 --- a/src/ask-password-api.c +++ b/src/ask-password-api.c @@ -480,3 +480,13 @@ finish: return r; } + +int ask_password_auto(const char *message, const char *icon, usec_t until, char **_passphrase) { + assert(message); + assert(_passphrase); + + if (isatty(STDIN_FILENO)) + return ask_password_tty(message, until, NULL, _passphrase); + else + return ask_password_agent(message, icon, until, _passphrase); +} |