summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/authenticate.c
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2001-06-03 19:55:57 +0000
committermillert <millert@openbsd.org>2001-06-03 19:55:57 +0000
commit0bc1d88d60feb46beb71ecf5bd69925a3dfbb4c2 (patch)
treeef9a413fb2df8da945ab475f966efc11ee6a2b57 /lib/libc/gen/authenticate.c
parentpass -v to ssh; from slade@shore.net (diff)
downloadwireguard-openbsd-0bc1d88d60feb46beb71ecf5bd69925a3dfbb4c2.tar.xz
wireguard-openbsd-0bc1d88d60feb46beb71ecf5bd69925a3dfbb4c2.zip
Don't bail out early for users w/o passwd file entries since we may
want to cons up a fake prompt for challenge/response auth methods. markus@ OK'd.
Diffstat (limited to 'lib/libc/gen/authenticate.c')
-rw-r--r--lib/libc/gen/authenticate.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/libc/gen/authenticate.c b/lib/libc/gen/authenticate.c
index eca44f5f289..c40b12063bd 100644
--- a/lib/libc/gen/authenticate.c
+++ b/lib/libc/gen/authenticate.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: authenticate.c,v 1.1 2000/11/21 00:51:16 millert Exp $ */
+/* $OpenBSD: authenticate.c,v 1.2 2001/06/03 19:55:57 millert Exp $ */
/*-
* Copyright (c) 1997 Berkeley Software Design, Inc. All rights reserved.
@@ -311,7 +311,7 @@ auth_usercheck(char *name, char *style, char *type, char *password)
*dot = '.';
}
}
- if (pwd == NULL || (lc = login_getclass(pwd->pw_class)) == NULL)
+ if ((lc = login_getclass(pwd ? pwd->pw_class : NULL)) == NULL)
return (NULL);
if ((style = login_getstyle(lc, style, type)) == NULL) {
@@ -329,7 +329,7 @@ auth_usercheck(char *name, char *style, char *type, char *password)
auth_setdata(as, password, strlen(password) + 1);
} else
as = NULL;
- as = auth_verify(as, style, name, pwd->pw_class, NULL);
+ as = auth_verify(as, style, name, lc->lc_class, NULL);
login_close(lc);
return (as);
}
@@ -375,7 +375,7 @@ auth_userchallenge(char *name, char *style, char *type, char **challengep)
*dot = '.';
}
}
- if (pwd == NULL || (lc = login_getclass(pwd->pw_class)) == NULL)
+ if ((lc = login_getclass(pwd ? pwd->pw_class : NULL)) == NULL)
return (NULL);
if ((style = login_getstyle(lc, style, type)) == NULL ||
@@ -385,7 +385,7 @@ auth_userchallenge(char *name, char *style, char *type, char **challengep)
}
if (auth_setitem(as, AUTHV_STYLE, style) < 0 ||
auth_setitem(as, AUTHV_NAME, name) < 0 ||
- auth_setitem(as, AUTHV_CLASS, pwd->pw_class) < 0) {
+ auth_setitem(as, AUTHV_CLASS, lc->lc_class) < 0) {
auth_close(as);
login_close(lc);
return (NULL);