summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2001-12-07 03:48:39 +0000
committermillert <millert@openbsd.org>2001-12-07 03:48:39 +0000
commitd2642b81824652d20ce7d4326c0ae4f1463c1082 (patch)
tree34fc3113d48232574a19cd3000f4f82e8da36038
parentAdd a floppy entry. (diff)
downloadwireguard-openbsd-d2642b81824652d20ce7d4326c0ae4f1463c1082.tar.xz
wireguard-openbsd-d2642b81824652d20ce7d4326c0ae4f1463c1082.zip
Catch SIGINT and SIGQUIT via the kbintr() signal handler.
Now that getpass() is interuptible we need to catch these so that the "Password unchanged." message is printed.
-rw-r--r--usr.bin/passwd/local_passwd.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/usr.bin/passwd/local_passwd.c b/usr.bin/passwd/local_passwd.c
index 932e9fe6026..ae4e14eb7ae 100644
--- a/usr.bin/passwd/local_passwd.c
+++ b/usr.bin/passwd/local_passwd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: local_passwd.c,v 1.22 2001/11/19 19:02:15 mpech Exp $ */
+/* $OpenBSD: local_passwd.c,v 1.23 2001/12/07 03:48:39 millert Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -35,7 +35,7 @@
#ifndef lint
/*static const char sccsid[] = "from: @(#)local_passwd.c 5.5 (Berkeley) 5/6/91";*/
-static const char rcsid[] = "$OpenBSD: local_passwd.c,v 1.22 2001/11/19 19:02:15 mpech Exp $";
+static const char rcsid[] = "$OpenBSD: local_passwd.c,v 1.23 2001/12/07 03:48:39 millert Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -152,6 +152,9 @@ getnewpasswd(pw, lc, authenticated)
int tries, pwd_tries;
char buf[_PASSWORD_LEN+1], salt[_PASSWORD_LEN];
+ (void)signal(SIGINT, kbintr);
+ (void)signal(SIGQUIT, kbintr);
+
if (!authenticated) {
(void)printf("Changing local password for %s.\n", pw->pw_name);
if (uid && pw->pw_passwd[0] &&
@@ -187,6 +190,9 @@ getnewpasswd(pw, lc, authenticated)
(void)printf("Couldn't generate salt.\n");
pw_error(NULL, 0, 0);
}
+ (void)signal(SIGINT, SIG_DFL);
+ (void)signal(SIGQUIT, SIG_DFL);
+
return(crypt(buf, salt));
}