apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bnicho...@apache.org
Subject cvs commit: apr-util/ldap apr_ldap_url.c
Date Mon, 25 Oct 2004 18:28:54 GMT
bnicholes    2004/10/25 11:28:54

  Modified:    ldap     apr_ldap_url.c
  Log:
  Fix a parsing problem with the LDAP URL where it was truncating the host portion after it
found the first :port.  Since an LDAP URL is allowed to contain multiple hosts:port, if the
first host included a :port, the other hosts were ignored.  This functionality also attempted
to parse-out of the URL the first :port that it found.  If one host in a multi-host URL specified
the default port (ie no port specified) and the second host specified an alternate port, the
result of the parse assumed that both hosts were reachable on the alternate port.  Therefore
the parsed host string must retain all :port specifiers.
  
  Revision  Changes    Path
  1.11      +3 -4      apr-util/ldap/apr_ldap_url.c
  
  Index: apr_ldap_url.c
  ===================================================================
  RCS file: /home/cvs/apr-util/ldap/apr_ldap_url.c,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- apr_ldap_url.c	26 Aug 2004 10:18:15 -0000	1.10
  +++ apr_ldap_url.c	25 Oct 2004 18:28:54 -0000	1.11
  @@ -352,14 +352,13 @@
               return APR_EGENERAL;
           }
           *r++ = '\0';
  -        q = strchr( r, ':' );
  +        q = strrchr( r, ':' );
       } else {
  -        q = strchr( url, ':' );
  +        q = strrchr( url, ':' );
       }
   
       if ( q != NULL ) {
  -        *q++ = '\0';
  -        apr_ldap_pvt_hex_unescape( q );
  +        apr_ldap_pvt_hex_unescape( ++q );
   
           if( *q == '\0' ) {
               result->reason = "Bad LDAP URL while parsing.";
  
  
  

Mime
View raw message