You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by mi...@apache.org on 2003/01/21 12:04:36 UTC

cvs commit: httpd-2.0/modules/experimental util_ldap.c

minfrin     2003/01/21 03:04:36

  Modified:    .        Tag: APACHE_2_0_BRANCH CHANGES
               modules/experimental Tag: APACHE_2_0_BRANCH util_ldap.c
  Log:
  Ensure LDAP version is set to v3 on every bind.
  PR: 14235
  Submitted by:	Sergey A. Lipnevich <se...@pisem.net>
  Reviewed by:	Graham Leggett
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.988.2.21 +3 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.988.2.20
  retrieving revision 1.988.2.21
  diff -u -r1.988.2.20 -r1.988.2.21
  --- CHANGES	21 Jan 2003 10:43:41 -0000	1.988.2.20
  +++ CHANGES	21 Jan 2003 11:04:35 -0000	1.988.2.21
  @@ -1,5 +1,8 @@
   Changes with Apache 2.0.45
   
  +  *) Ensure LDAP version is set to v3 on every bind. PR 14235.
  +     [Sergey A. Lipnevich <se...@pisem.net>]
  +
     *) Fix mod_ldap to open an existing shared memory file should one
        already exist. PR 12757. [Scooter Morris <sc...@gene.com>,
        Graham Leggett]
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.6.2.4   +13 -8     httpd-2.0/modules/experimental/util_ldap.c
  
  Index: util_ldap.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/experimental/util_ldap.c,v
  retrieving revision 1.6.2.3
  retrieving revision 1.6.2.4
  diff -u -r1.6.2.3 -r1.6.2.4
  --- util_ldap.c	21 Jan 2003 10:51:34 -0000	1.6.2.3
  +++ util_ldap.c	21 Jan 2003 11:04:36 -0000	1.6.2.4
  @@ -265,6 +265,18 @@
                                     util_ldap_connection_destroy,
                                     apr_pool_cleanup_null);
   
  +#if LDAP_VENDOR_VERSION >= 20000
  +    /* set protocol version 3 on this connection */
  +        {
  +            int version = LDAP_VERSION3;
  +
  +            if ((result = ldap_set_option(ldc->ldap, LDAP_OPT_PROTOCOL_VERSION,
  +                                         &version)) != LDAP_SUCCESS) {
  +                /* setting LDAP version failed - ignore error */
  +            }
  +        }
  +#endif
  +
           /* Set the alias dereferencing option */
   #if LDAP_VERSION_MAX == 2
           ldc->ldap->ld_deref = ldc->deref;
  @@ -301,14 +313,7 @@
   
   #ifdef APU_HAS_LDAP_STARTTLS
           if (ldc->starttls) {
  -            int version = LDAP_VERSION3;
  -
  -            /* Also we have to set the connection to use protocol version 3,
  -             * since we're using TLS. */
  -            if ((result = ldap_set_option(ldc->ldap, LDAP_OPT_PROTOCOL_VERSION,
  -                                         &version)) != LDAP_SUCCESS) {
  -		/* setting LDAP version failed - ignore error */
  -            }
  +            /* LDAP protocol version 3 is required for TLS */
   
               /* 
                * In util_ldap_connection_find, we compare ldc->withtls to