From: Howard Chu Date: Mon, 27 Nov 2006 18:59:46 +0000 (+0000) Subject: allow file: URLs without authority spec. X-Git-Tag: OPENLDAP_REL_ENG_2_4_4ALPHA~8^2~436 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e7be7301c20b8232c03574bc07ff255246d3a34f;p=openldap allow file: URLs without authority spec. --- diff --git a/libraries/liblutil/fetch.c b/libraries/liblutil/fetch.c index 661bc1e75b..3177744097 100644 --- a/libraries/liblutil/fetch.c +++ b/libraries/liblutil/fetch.c @@ -48,17 +48,12 @@ ldif_open_url( url = fetchGetURL( (char*) urlstr, "" ); #else - if( strncasecmp( "file://", urlstr, sizeof("file://")-1 ) == 0 ) { - p = strchr( &urlstr[sizeof("file://")-1], '/' ); - if( p == NULL ) { - return NULL; - } + if( strncasecmp( "file:", urlstr, sizeof("file:")-1 ) == 0 ) { + p = urlstr + sizeof("file:")-1; /* we don't check for LDAP_DIRSEP since URLs should contain '/' */ - if( p[1] == '.' && ( p[2] == '/' || ( p[2] == '.' && p[3] == '/' ))) { - /* skip over false root */ - p++; - } + if ( p[0] == '/' && p[1] == '/' ) + p += 2; p = ber_strdup( p ); ldap_pvt_hex_unescape( p );