chiark / gitweb /
cryptsetup: support non-LUKS crypto partitions
[elogind.git] / src / ask-password-api.c
index e4ee8adb4f51aa3a3bcf8c03a94a0dc440f24673..9f7023e32847ae14fb40e37f4ca949623738dd5b 100644 (file)
@@ -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);
+}