1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-12 03:00:28 +00:00
freebsd-ports/news/nntpcache/files/patch-src-authinfo_ldap.c
Dirk Meyer 2002767acb Updated with new Option, some cleanups.
>Number:         30849
news/nntpcache fails compiling authinfo_pam.c, add radius & ldap auth mechanisms.
The fix is to place a #ifndef __FreeBSD__ .. #endif arround
<security/pam_misc.h> in authinfo_pam.c.
The attached patch corrects this problem, and adds additional authentication
functionality to the nntpcache port (RADIUS, LDAP[v1,v2]).
files/patch-src-authinfo_pam.ext removed due to a post-configure target is
added to the Makefile that recreates the authinfo_[pam,radius,ldap].ext files.

PR:		30849
Submitted by:	hetzels@westbend.net
2002-03-30 10:14:36 +00:00

20 lines
693 B
C

--- src/authinfo_ldap.c.orig Sat Dec 18 12:08:30 1999
+++ src/authinfo_ldap.c Wed Sep 26 10:55:27 2001
@@ -78,7 +78,16 @@
lderr = ldap_bind_s(ld, dnbuf, pass, LDAP_AUTH_SIMPLE);
if (lderr != LDAP_SUCCESS && lderr != LDAP_INVALID_CREDENTIALS && lderr != LDAP_INAPPROPRIATE_AUTH)
+#if LDAP_API_VERSION >= 2004
+ {
+ int ld_errno = 0;
+ ldap_get_option(ld, LDAP_OPT_ERROR_NUMBER, &ld_errno);
+ logen(("LDAP ERROR: ldap user bind failed (%d): %s", lderr, ldap_err2string(ld_errno)));
+ }
+#else
+
logen(("LDAP ERROR: ldap user bind failed (%d): %s", lderr, ldap_err2string(GET_LDERROR(ld))));
+#endif
ldap_unbind(ld);
memset(pass, strlen(pass), 0);
if (lderr == LDAP_SUCCESS) {