Module Name: src
Committed By: snj
Date: Fri Feb 26 21:57:12 UTC 2016
Modified Files:
src/lib/libc/gen [netbsd-7]: getpass.c
Log Message:
Pull up following revision(s) (requested by christos in ticket #1101):
lib/libc/gen/getpass.c: revision 1.30
PR/50695: coypu: ctrl-c in su password input breaks shell (bash, csh)
Always restore the tty settings.
To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.28.2.1 src/lib/libc/gen/getpass.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libc/gen/getpass.c
diff -u src/lib/libc/gen/getpass.c:1.28 src/lib/libc/gen/getpass.c:1.28.2.1
--- src/lib/libc/gen/getpass.c:1.28 Mon Jun 16 16:29:30 2014
+++ src/lib/libc/gen/getpass.c Fri Feb 26 21:57:12 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: getpass.c,v 1.28 2014/06/16 16:29:30 christos Exp $ */
+/* $NetBSD: getpass.c,v 1.28.2.1 2016/02/26 21:57:12 snj Exp $ */
/*-
* Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: getpass.c,v 1.28 2014/06/16 16:29:30 christos Exp $");
+__RCSID("$NetBSD: getpass.c,v 1.28.2.1 2016/02/26 21:57:12 snj Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@@ -287,12 +287,12 @@ add:
good = true;
restore:
+out:
if (havetty) {
c = errno;
(void)tcsetattr(fd[0], TCSAFLUSH|TCSASOFT, >);
errno = c;
}
-out:
if (good && (flags & GETPASS_ECHO_NL))
(void)write(fd[1], "\n", 1);