chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
systemctl: always null-terminate the password
[elogind.git]
/
src
/
ask-password-api.c
diff --git
a/src/ask-password-api.c
b/src/ask-password-api.c
index f43075e60194e5a563d345f217109198479fb97c..af1b611f2727e1f57561dd7eb3ba0049e0deacbb 100644
(file)
--- a/
src/ask-password-api.c
+++ b/
src/ask-password-api.c
@@
-179,9
+179,6
@@
int ask_password_tty(
}
}
}
}
- if (ttyfd >= 0)
- loop_write(ttyfd, "\n", 1, false);
-
passphrase[p] = 0;
if (!(*_passphrase = strdup(passphrase))) {
passphrase[p] = 0;
if (!(*_passphrase = strdup(passphrase))) {
@@
-196,8
+193,11
@@
finish:
close_nointr_nofail(notify);
if (ttyfd >= 0) {
close_nointr_nofail(notify);
if (ttyfd >= 0) {
- if (reset_tty)
+
+ if (reset_tty) {
+ loop_write(ttyfd, "\n", 1, false);
tcsetattr(ttyfd, TCSADRAIN, &old_termios);
tcsetattr(ttyfd, TCSADRAIN, &old_termios);
+ }
close_nointr_nofail(ttyfd);
}
close_nointr_nofail(ttyfd);
}