]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/shared/ask-password-api.h
tree-wide: drop 'This file is part of systemd' blurb
[thirdparty/systemd.git] / src / shared / ask-password-api.h
CommitLineData
53e1b683 1/* SPDX-License-Identifier: LGPL-2.1+ */
c2f1db8f 2#pragma once
7f4e0805
LP
3
4/***
7f4e0805 5 Copyright 2010 Lennart Poettering
7f4e0805
LP
6***/
7
3f6fd1ba
LP
8#include <stdbool.h>
9
10#include "time-util.h"
7f4e0805 11
e287086b 12typedef enum AskPasswordFlags {
ef31828d
LP
13 ASK_PASSWORD_ACCEPT_CACHED = 1 << 0,
14 ASK_PASSWORD_PUSH_CACHE = 1 << 1,
15 ASK_PASSWORD_ECHO = 1 << 2, /* show the password literally while reading, instead of "*" */
16 ASK_PASSWORD_SILENT = 1 << 3, /* do no show any password at all while reading */
17 ASK_PASSWORD_NO_TTY = 1 << 4,
18 ASK_PASSWORD_NO_AGENT = 1 << 5,
19 ASK_PASSWORD_CONSOLE_COLOR = 1 << 6, /* Use color if /dev/console points to a console that supports color */
e287086b
LP
20} AskPasswordFlags;
21
daa55720 22int ask_password_tty(int tty_fd, const char *message, const char *keyname, usec_t until, AskPasswordFlags flags, const char *flag_file, char **ret);
e287086b
LP
23int ask_password_agent(const char *message, const char *icon, const char *id, const char *keyname, usec_t until, AskPasswordFlags flag, char ***ret);
24int ask_password_keyring(const char *keyname, AskPasswordFlags flags, char ***ret);
25int ask_password_auto(const char *message, const char *icon, const char *id, const char *keyname, usec_t until, AskPasswordFlags flag, char ***ret);