Re: [exim] Compiling and using exim with LDAP on Solaris wit…

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Robert Bannocks
Datum:  
To: exim-users
CC: Christian Kuehn
Betreff: Re: [exim] Compiling and using exim with LDAP on Solaris withSolarios LDAP libraries
Philip,

I am no LDAP guru and my C programming is a little rusty, but this
simple patch seems to resolve the issue.
Another solution is to compile against openldap libraries which return
different return codes and do not exhibit this behaviour
(specifically they return LDAP_SUCESS)

bash-2.05# diff -c src/lookups/ldap.c-orig src/lookups/ldap.c
*** src/lookups/ldap.c-orig     Tue Dec  5 15:46:33 2006
--- src/lookups/ldap.c  Tue Dec  5 16:50:18 2006
***************
*** 864,870 ****
  DEBUG(D_lookup) debug_printf("ldap_parse_result yielded %d: %s\n",
    rc, ldap_err2string(rc));


! if (rc != LDAP_SUCCESS && rc != LDAP_SIZELIMIT_EXCEEDED)
    {
    *errmsg = string_sprintf("LDAP search failed - error %d:
%s%s%s%s%s",
      rc,
--- 864,874 ----
  DEBUG(D_lookup) debug_printf("ldap_parse_result yielded %d: %s\n",
    rc, ldap_err2string(rc));


! if (rc != LDAP_SUCCESS && rc != LDAP_SIZELIMIT_EXCEEDED
! #ifdef LDAP_RES_SEARCH_REFERENCE
!     && rc != LDAP_RES_SEARCH_REFERENCE
! #endif
!     )
    {
    *errmsg = string_sprintf("LDAP search failed - error %d:
%s%s%s%s%s",
      rc,


Hope that helps. Feel free to include it in the source.

RB


> -----Original Message-----
> From: Philip Hazel [mailto:ph10@hermes.cam.ac.uk]
> Sent: 05 December 2006 14:19
> To: Robert Bannocks
> Cc: exim-users@???; Christian Kuehn
> Subject: RE: [exim] Compiling and using exim with LDAP on
> Solaris with Solarios LDAP libraries
>
> On Tue, 5 Dec 2006, Robert Bannocks wrote:
>
> > But at no point latter in the code is the reference dealt with
>
> Well, I'm afraid I'm no LDAP expert. Most of the code in
> ldap.c is contributed (though I've tidied up some of it). As
> I quoted from the
> ChangeLog:
>
> > > 54. The LDAP lookup was not handling a return of
> > >     LDAP_RES_SEARCH_REFERENCE. A patch that reportedly 
> fixes this has
> > >     been added.

>
> It seems as though the patch didn't fix all of it. If someone
> sends me another patch I'll be happy to consider it (though
> not for 4.64, unless it is *very* small, because I'm wrapping
> that one up). I don't have the knowledge (or the testing
> facilities) to try to fix this myself. Or, at the moment, any
> time to do the necessary research or figure out how one might
> test this. (I really don't understand LDAP much at all.)
>
> -- 
> Philip Hazel            University of Cambridge Computing Service
> Get the Exim 4 book:    http://www.uit.co.uk/exim-book

>