summaryrefslogtreecommitdiff
path: root/src/tty-ask-password-agent/tty-ask-password-agent.c
diff options
context:
space:
mode:
authorDaniel Mack <github@zonque.org>2015-10-08 16:09:09 +0200
committerDaniel Mack <github@zonque.org>2015-10-08 16:09:09 +0200
commitad86c1335a2a474f91186a736a5231d0c66313c6 (patch)
treef3cc983826f4067f8dcb12f4828a2e2c8cc8e64c /src/tty-ask-password-agent/tty-ask-password-agent.c
parent8f3db94d9d905e6c31c1fcd0dcc6be7b78034c5c (diff)
parent1af1f2f92ef52e3e905b7928d42345d9c48e7e7b (diff)
Merge pull request #1496 from poettering/stdin-fd
allow passing in fds for stdin/stdout/stderr for transient services
Diffstat (limited to 'src/tty-ask-password-agent/tty-ask-password-agent.c')
-rw-r--r--src/tty-ask-password-agent/tty-ask-password-agent.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/tty-ask-password-agent/tty-ask-password-agent.c b/src/tty-ask-password-agent/tty-ask-password-agent.c
index 5dbc0a9bcc..93cce186f0 100644
--- a/src/tty-ask-password-agent/tty-ask-password-agent.c
+++ b/src/tty-ask-password-agent/tty-ask-password-agent.c
@@ -315,6 +315,10 @@ static int parse_password(const char *filename, char **wall) {
tty_fd = acquire_terminal("/dev/console", false, false, false, USEC_INFINITY);
if (tty_fd < 0)
return log_error_errno(tty_fd, "Failed to acquire /dev/console: %m");
+
+ r = reset_terminal_fd(tty_fd, true);
+ if (r < 0)
+ log_warning_errno(r, "Failed to reset terminal, ignoring: %m");
}
r = ask_password_tty(message, NULL, not_after, echo ? ASK_PASSWORD_ECHO : 0, filename, &password);