Linux-PAM's pam_start(3) fails with a bogus error message if passed the

pam_conv argument is NULL.  OpenPAM doesn't care, but to make things
easier for people porting this code to other systems (or -STABLE), use
a dummy struct pam_conv instead of NULL.

Pointed out by:	Damien Miller <djm@mindrot.org>
This commit is contained in:
Dag-Erling Smørgrav 2003-02-03 14:10:28 +00:00
parent b946f5e1ff
commit 2adf4e49c2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=110283

View File

@ -242,6 +242,7 @@ pam_cleanup(void *arg)
static int
pam_init(const char *user)
{
struct pam_conv no_conv = { NULL, NULL };
extern ServerOptions options;
extern u_int utmp_len;
const char *pam_rhost, *pam_user;
@ -257,7 +258,7 @@ pam_init(const char *user)
pam_handle = NULL;
}
debug("PAM: initializing for \"%s\"", user);
pam_err = pam_start("sshd", user, NULL, &pam_handle);
pam_err = pam_start("sshd", user, &no_conv, &pam_handle);
if (pam_err != PAM_SUCCESS)
return (-1);
pam_rhost = get_remote_name_or_ip(utmp_len,