summaryrefslogtreecommitdiffstats
path: root/libexec
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2019-12-24 13:13:33 +0000
committermillert <millert@openbsd.org>2019-12-24 13:13:33 +0000
commitd89a8fc2b45c1859b22176d1afae3924a603e375 (patch)
tree87a2ee7bc22e75e37cbdf4665ce31719149f8091 /libexec
parentThe console buffer is allocated during startup. initconsbuf() is (diff)
downloadwireguard-openbsd-d89a8fc2b45c1859b22176d1afae3924a603e375.tar.xz
wireguard-openbsd-d89a8fc2b45c1859b22176d1afae3924a603e375.zip
Merge two missed fixes from login.c to login_passwd.c.
- use the correct length when checking for "-v lastchance=yes" - don't try to zero pass if it is NULL From miod@
Diffstat (limited to 'libexec')
-rw-r--r--libexec/login_passwd/login_passwd.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libexec/login_passwd/login_passwd.c b/libexec/login_passwd/login_passwd.c
index febb9f0cb9d..cd4f54709d4 100644
--- a/libexec/login_passwd/login_passwd.c
+++ b/libexec/login_passwd/login_passwd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: login_passwd.c,v 1.16 2019/12/21 18:56:27 millert Exp $ */
+/* $OpenBSD: login_passwd.c,v 1.17 2019/12/24 13:13:33 millert Exp $ */
/*-
* Copyright (c) 1995 Berkeley Software Design, Inc. All rights reserved.
@@ -86,8 +86,8 @@ main(int argc, char *argv[])
case 'v':
if (strncmp(optarg, "wheel=", 6) == 0)
wheel = optarg + 6;
- else if (strncmp(optarg, "lastchance=", 10) == 0)
- lastchance = (strcmp(optarg + 10, "yes") == 0);
+ else if (strncmp(optarg, "lastchance=", 11) == 0)
+ lastchance = (strcmp(optarg + 11, "yes") == 0);
break;
default:
syslog(LOG_ERR, "usage error");
@@ -160,7 +160,8 @@ main(int argc, char *argv[])
}
rc = crypt_checkpass(pass, pwd ? pwd->pw_passwd : NULL);
- explicit_bzero(pass, strlen(pass));
+ if (pass != NULL)
+ explicit_bzero(pass, strlen(pass));
if (rc == 0) {
if (login_check_expire(back, pwd, class, lastchance) == 0) {
fprintf(back, BI_AUTH "\n");