another readpassphrase() fix from OpenBSD libc

revision 1.32
date: 2026/10/15 16:40:50;  author: millert;  state: Exp;  lines: +2 -2;  commitid: PeYLMhPn3x9iWE37;
Don't print newline after reading password if interrupted by signal.
Avoids an extra newline when the user presses ^C or ^\ at the
password prompt.  OK deraadt@
This commit is contained in:
Damien Miller committed 2026-10-16 17:13:41 +11:00
1 parent bfbc10c2bd
commit 6545e6a55d
1 file changed
+2 -2
+2 -2
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: readpassphrase.c,v 1.31 2026/10/15 05:55:06 djm Exp $ */
/* $OpenBSD: readpassphrase.c,v 1.32 2026/10/15 16:40:50 millert Exp $ */
/*
* Copyright (c) 2000-2002, 2007, 2010
@@ -162,7 +162,7 @@ restart:
}
*p = '\0';
save_errno = errno;
if (!(term.c_lflag & ECHO))
if (!(term.c_lflag & ECHO) && !(nr == -1 && errno == EINTR))
(void)write(output, "\n", 1);
/* Restore old terminal settings and signals. */