prefer login_getpwclass() to login_getclass()
FreeBSD has login_getpwclass() that does some special magic for UID=0. Prefer this to login_getclass() as its easier to emulate the former with the latter. Based on FreeBSD PR 37416 via Ed Maste; ok dtucker@
This commit is contained in:
parent
d0763c8d56
commit
845fe9811c
2
auth.c
2
auth.c
|
@ -604,7 +604,7 @@ getpwnamallow(struct ssh *ssh, const char *user)
|
|||
if (!allowed_user(ssh, pw))
|
||||
return (NULL);
|
||||
#ifdef HAVE_LOGIN_CAP
|
||||
if ((lc = login_getclass(pw->pw_class)) == NULL) {
|
||||
if ((lc = login_getpwclass(pw)) == NULL) {
|
||||
debug("unable to get login class: %s", user);
|
||||
return (NULL);
|
||||
}
|
||||
|
|
|
@ -1841,6 +1841,7 @@ AC_CHECK_FUNCS([ \
|
|||
llabs \
|
||||
localtime_r \
|
||||
login_getcapbool \
|
||||
login_getpwclass \
|
||||
md5_crypt \
|
||||
memmem \
|
||||
memmove \
|
||||
|
|
|
@ -48,6 +48,10 @@
|
|||
#include "blf.h"
|
||||
#include "fnmatch.h"
|
||||
|
||||
#if defined(HAVE_LOGIN_CAP) && !defined(HAVE_LOGIN_GETPWCLASS)
|
||||
# define login_getpwclass(pw) login_getclass(pw->pw_class)
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_BASENAME
|
||||
char *basename(const char *path);
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue