summaryrefslogtreecommitdiffstats
path: root/libexec
diff options
context:
space:
mode:
authoryar <yar@FreeBSD.org>2004-11-01 16:05:57 +0000
committeryar <yar@FreeBSD.org>2004-11-01 16:05:57 +0000
commit75e4d56d9fbebf759a7f5337aa9413eefe66553e (patch)
tree6deab124363c52ed0d8fdd7ad5bb2c382daa4332 /libexec
parentc6ef06fc302baa7e0f895dc256456ee334cd4665 (diff)
downloadFreeBSD-src-75e4d56d9fbebf759a7f5337aa9413eefe66553e.zip
FreeBSD-src-75e4d56d9fbebf759a7f5337aa9413eefe66553e.tar.gz
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
Diffstat (limited to 'libexec')
-rw-r--r--libexec/ftpd/ftpd.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c
index 6b10f9b..3325276 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;
}
OpenPOWER on IntegriCloud