]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/shared/ask-password-api.h
tty-ask-password-agent: reenable color for boot-time password prompt
[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/***
5 This file is part of systemd.
6
7 Copyright 2010 Lennart Poettering
8
9 systemd is free software; you can redistribute it and/or modify it
5430f7f2
LP
10 under the terms of the GNU Lesser General Public License as published by
11 the Free Software Foundation; either version 2.1 of the License, or
7f4e0805
LP
12 (at your option) any later version.
13
14 systemd is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5430f7f2 17 Lesser General Public License for more details.
7f4e0805 18
5430f7f2 19 You should have received a copy of the GNU Lesser General Public License
7f4e0805
LP
20 along with systemd; If not, see <http://www.gnu.org/licenses/>.
21***/
22
3f6fd1ba
LP
23#include <stdbool.h>
24
25#include "time-util.h"
7f4e0805 26
e287086b 27typedef enum AskPasswordFlags {
f612f8fb
LP
28 ASK_PASSWORD_ACCEPT_CACHED = 1U << 0,
29 ASK_PASSWORD_PUSH_CACHE = 1U << 1,
30 ASK_PASSWORD_ECHO = 1U << 2, /* show the password literally while reading, instead of "*" */
31 ASK_PASSWORD_SILENT = 1U << 3, /* do no show any password at all while reading */
32 ASK_PASSWORD_NO_TTY = 1U << 4,
33 ASK_PASSWORD_NO_AGENT = 1U << 5,
c2b32159 34 ASK_PASSWORD_CONSOLE_COLOR = 1U << 6, /* Use color if /dev/console points to a console that supports color */
e287086b
LP
35} AskPasswordFlags;
36
daa55720 37int 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
38int ask_password_agent(const char *message, const char *icon, const char *id, const char *keyname, usec_t until, AskPasswordFlags flag, char ***ret);
39int ask_password_keyring(const char *keyname, AskPasswordFlags flags, char ***ret);
40int ask_password_auto(const char *message, const char *icon, const char *id, const char *keyname, usec_t until, AskPasswordFlags flag, char ***ret);