summaryrefslogtreecommitdiff
path: root/ldap/apr_ldap_url.c
diff options
context:
space:
mode:
authorbnicholes <bnicholes@13f79535-47bb-0310-9956-ffa450edef68>2004-10-25 18:28:54 +0000
committerbnicholes <bnicholes@13f79535-47bb-0310-9956-ffa450edef68>2004-10-25 18:28:54 +0000
commit35bb57b8ee01bd481df4f63856419a5fa9a16045 (patch)
tree3d0ee48d6bc672f4b9b77b42d4e8f3b7a63720ba /ldap/apr_ldap_url.c
parent44446e59aabf4e2ad2ac93c2fc167ed48eb9cca0 (diff)
downloadlibapr-util-35bb57b8ee01bd481df4f63856419a5fa9a16045.tar.gz
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.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr-util/trunk@59148 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'ldap/apr_ldap_url.c')
-rw-r--r--ldap/apr_ldap_url.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/ldap/apr_ldap_url.c b/ldap/apr_ldap_url.c
index a0b8dd28..afdb6761 100644
--- a/ldap/apr_ldap_url.c
+++ b/ldap/apr_ldap_url.c
@@ -352,14 +352,13 @@ APU_DECLARE(int) apr_ldap_url_parse_ext(apr_pool_t *pool,
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.";