[exim-cvs] cvs commit: exim/exim-src/src/lookups ldap.c exi…

Góra strony
Delete this message
Reply to this message
Autor: Philip Hazel
Data:  
Dla: exim-cvs
Temat: [exim-cvs] cvs commit: exim/exim-src/src/lookups ldap.c exim/exim-test-orig/AutoTest/stdout 901
ph10 2004/11/11 12:05:54 GMT

  Modified files:
    exim-src/src/lookups ldap.c 
    exim-test-orig/AutoTest/stdout 901 
  Log:
  Two minor tidies to the recent ldap.c changes.


  Revision  Changes    Path
  1.3       +11 -11    exim/exim-src/src/lookups/ldap.c
  1.3       +1 -1      exim/exim-test-orig/AutoTest/stdout/901


  Index: ldap.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/lookups/ldap.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ldap.c    10 Nov 2004 14:15:20 -0000    1.2
  +++ ldap.c    11 Nov 2004 12:05:54 -0000    1.3
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/lookups/ldap.c,v 1.2 2004/11/10 14:15:20 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/lookups/ldap.c,v 1.3 2004/11/11 12:05:54 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -129,7 +129,7 @@
     password      password for authentication, or NULL
     sizelimit     max number of entries returned, or 0 for no limit
     timelimit     max time to wait, or 0 for no limit
  -  tcplimit      max time to connect, or 0 for OS default
  +  tcplimit      max time for network activity, e.g. connect, or 0 for OS default
     deference     the dereference option, which is one of
                     LDAP_DEREF_{NEVER,SEARCHING,FINDING,ALWAYS}


  @@ -271,6 +271,15 @@
     if (ldapi || port == lcp->port) break;
     }


  +/* Use this network timeout in any requests. */
  +
  +if (tcplimit > 0)
  +  {
  +  timeout.tv_sec = tcplimit;
  +  timeout.tv_usec = 0;
  +  timeoutptr = &timeout;
  +  }
  +
   /* If no cached connection found, we must open a connection to the server. If
   the server name is actually an absolute path, we set ldapi=TRUE above. This
   requests connection via a Unix socket. However, as far as I know, only OpenLDAP
  @@ -447,15 +456,6 @@
         host, porttext);
     }


-/* Whatever follows, obey this timeout in any requests. */
-
-if (tcplimit > 0)
- {
- timeout.tv_sec = tcplimit;
- timeout.tv_usec = 0;
- timeoutptr = &timeout;
- }
-
/* Bind with the user/password supplied, or an anonymous bind if these values
are NULL, unless a cached connection is already bound with the same values. */

  @@ -474,7 +474,7 @@
          == -1)
       {
       *errmsg = string_sprintf("failed to bind the LDAP connection to server "
  -      "%s%s - LDAP error", host, porttext);
  +      "%s%s - ldap_bind() returned -1", host, porttext);
       goto RETURN_ERROR;
       }



  Index: 901
  ===================================================================
  RCS file: /home/cvs/exim/exim-test-orig/AutoTest/stdout/901,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- 901    10 Nov 2004 14:15:21 -0000    1.2
  +++ 901    11 Nov 2004 12:05:54 -0000    1.3
  @@ -98,7 +98,7 @@

>
> Expect failure to contact server
> ${if ldapauth {size=1 time=0 user="cn=manager,o=University of Cambridge,c=UK" pass=known ldaps://127.0.0.1:9999/o=University%20of%20Cambridge,c=UK?sn?sub?(cn=*)}{yes}{no}}
-> Failed: failed to bind the LDAP connection to server 127.0.0.1:9999 - LDAP error
+> Failed: failed to bind the LDAP connection to server 127.0.0.1:9999 - ldap_bind() returned -1
>
> Expect "yes"
> ${if ldapauth { size=1 time=0 user="cn=manager,o=University of Cambridge,c=UK" pass=secret ldap:///o=University%20of%20Cambridge,c=UK?sn?sub?(cn=*)}{yes}{no}}