ask-password-api.c revision 1c8da044469acabcfc479ba3276954da53210830
883N/A along with systemd; If not, see <http://www.gnu.org/licenses/>.
883N/A#include "ask-password-api.h"
883N/A char **_passphrase) {
bool reset_tty = false;
bool silent_mode = false;
bool dirty = false;
if (flag_file) {
if (notify < 0) {
r = -errno;
goto finish;
r = -errno;
goto finish;
if (ttyfd >= 0) {
r = -errno;
goto finish;
r = -errno;
goto finish;
reset_tty = true;
ssize_t n;
if (until > 0) {
usec_t y;
if (y > until) {
r = -ETIME;
goto finish;
if (flag_file)
r = -errno;
goto finish;
r = -errno;
goto finish;
r = -ETIME;
goto finish;
r = -errno;
goto finish;
if (!silent_mode)
if (!silent_mode)
silent_mode = true;
if (ttyfd >= 0)
} else if (ttyfd >= 0)
silent_mode = true;
if (ttyfd >= 0)
passphrase[p++] = c;
dirty = true;
r = -ENOMEM;
goto finish;
*_passphrase = x;
int fd;
} sa = {
if (fd < 0)
snprintf(sa.un.sun_path, sizeof(sa.un.sun_path)-1, "/run/systemd/ask-password/sck.%" PRIx64, random_u64());
r = -errno;
goto fail;
r = -errno;
goto fail;
r = log_oom();
goto fail;
*name = c;
return fd;
fail:
int ask_password_agent(
const char *message,
const char *icon,
const char *id,
bool echo,
bool accept_cached,
char ***_passphrases) {
if (fd < 0) {
r = -errno;
goto finish;
r = -errno;
goto finish;
if (signal_fd < 0) {
r = -errno;
goto finish;
if (socket_fd < 0) {
r = socket_fd;
goto finish;
fprintf(f,
getpid(),
until);
if (message)
if (icon)
if (id)
fflush(f);
if (ferror(f)) {
r = -errno;
goto finish;
r = -errno;
goto finish;
} control;
ssize_t n;
usec_t t;
r = -ETIME;
goto finish;
r = -errno;
goto finish;
r = -ETIME;
goto finish;
r = -EINTR;
goto finish;
r = -EIO;
goto finish;
r = -errno;
goto finish;
r = -ENOMEM;
goto finish;
if (strv_length(l) <= 0) {
strv_free(l);
*_passphrases = l;
r = -ECANCELED;
goto finish;
if (socket_name)
if (final[0])
r = strv_consume(&l, s);
*_passphrases = l;