From 545ea86459d68640e5337fa94217475cee977544 Mon Sep 17 00:00:00 2001 From: Yaroslav Tykhiy Date: Mon, 1 Nov 2004 16:05:57 +0000 Subject: OpenPAM allows passing a NULL "pamh" to pam_strerror() to indicate that the creation of a PAM context has failed. N.B. This does not apply to pam_strerror() in RELENG_4, it will mishandle a NULL "pamh". Discussed with: des --- libexec/ftpd/ftpd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'libexec/ftpd') diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index 6b10f9baf45d..33252760f4fb 100644 --- a/libexec/ftpd/ftpd.c +++ b/libexec/ftpd/ftpd.c @@ -1258,8 +1258,11 @@ auth_pam(struct passwd **ppw, const char *pass) e = pam_start("ftpd", (*ppw)->pw_name, &conv, &pamh); if (e != PAM_SUCCESS) { - /* pamh is NULL, cannot use pam_strerror() */ - syslog(LOG_ERR, "pam_start failed"); + /* + * In OpenPAM, it's OK to pass NULL to pam_strerror() + * if context creation has failed in the first place. + */ + syslog(LOG_ERR, "pam_start: %s", pam_strerror(NULL, e)); return -1; } -- cgit v1.3