From 78bd3bf6a3d58e3da5993ff5bc64fbf72a466854 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Fri, 11 Nov 2005 09:54:07 +0000 Subject: [PATCH] handle LDAPv2 when returning timelimit; silence warning --- servers/slapd/back-ldap/bind.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/servers/slapd/back-ldap/bind.c b/servers/slapd/back-ldap/bind.c index 5c0ed2f69e..a77af50c9f 100644 --- a/servers/slapd/back-ldap/bind.c +++ b/servers/slapd/back-ldap/bind.c @@ -316,7 +316,12 @@ retry:; rc = ldap_parse_extended_result( ld, res, NULL, &data, 0 ); if ( rc == LDAP_SUCCESS ) { - rc = ldap_result2error( ld, res, 1 ); + int err; + rc = ldap_parse_result( ld, res, &err, + NULL, NULL, NULL, NULL, 1 ); + if ( rc == LDAP_SUCCESS ) { + rc = err; + } res = NULL; /* FIXME: in case a referral @@ -834,7 +839,8 @@ retry:; case 0: if ( timeout ) { (void)ldap_abandon_ext( lc->lc_ld, msgid, NULL, NULL ); - rs->sr_err = LDAP_ADMINLIMIT_EXCEEDED; + rs->sr_err = op->o_protocol >= LDAP_VERSION3 ? + LDAP_ADMINLIMIT_EXCEEDED : LDAP_OPERATIONS_ERROR; rs->sr_text = "Operation timed out"; break; }