Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc/gen PR/50695: coypu: ctrl-c in su password input br...
details: https://anonhg.NetBSD.org/src/rev/c87bda8c031c
branches: trunk
changeset: 343370:c87bda8c031c
user: christos <christos%NetBSD.org@localhost>
date: Sun Jan 31 23:41:38 2016 +0000
description:
PR/50695: coypu: ctrl-c in su password input breaks shell (bash, csh)
Always restore the tty settings.
diffstat:
lib/libc/gen/getpass.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diffs (32 lines):
diff -r c7fb0f22b6ec -r c87bda8c031c lib/libc/gen/getpass.c
--- a/lib/libc/gen/getpass.c Sun Jan 31 23:14:34 2016 +0000
+++ b/lib/libc/gen/getpass.c Sun Jan 31 23:41:38 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: getpass.c,v 1.29 2014/09/18 13:58:20 christos Exp $ */
+/* $NetBSD: getpass.c,v 1.30 2016/01/31 23:41:38 christos 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.29 2014/09/18 13:58:20 christos Exp $");
+__RCSID("$NetBSD: getpass.c,v 1.30 2016/01/31 23:41:38 christos Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@@ -288,12 +288,12 @@
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);
Home |
Main Index |
Thread Index |
Old Index