aboutsummaryrefslogtreecommitdiff
path: root/libexec/ftpd
diff options
context:
space:
mode:
authorYaroslav Tykhiy <ytykhiy@gmail.com>2004-11-01 16:05:57 +0000
committerYaroslav Tykhiy <ytykhiy@gmail.com>2004-11-01 16:05:57 +0000
commit545ea86459d68640e5337fa94217475cee977544 (patch)
tree6deab124363c52ed0d8fdd7ad5bb2c382daa4332 /libexec/ftpd
parent57c407198989bccb27c357171a8883cc646b58f8 (diff)
downloadsrc-545ea86459d68640e5337fa94217475cee977544.tar.gz
src-545ea86459d68640e5337fa94217475cee977544.zip
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
Notes
Notes: svn path=/head/; revision=137108
Diffstat (limited to 'libexec/ftpd')
-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 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;
}