allow file: URLs without authority spec.

This commit is contained in:
Howard Chu 2006-11-27 18:59:46 +00:00
parent 9446f8554b
commit e7be7301c2

View file

@ -48,17 +48,12 @@ ldif_open_url(
url = fetchGetURL( (char*) urlstr, "" ); url = fetchGetURL( (char*) urlstr, "" );
#else #else
if( strncasecmp( "file://", urlstr, sizeof("file://")-1 ) == 0 ) { if( strncasecmp( "file:", urlstr, sizeof("file:")-1 ) == 0 ) {
p = strchr( &urlstr[sizeof("file://")-1], '/' ); p = urlstr + sizeof("file:")-1;
if( p == NULL ) {
return NULL;
}
/* we don't check for LDAP_DIRSEP since URLs should contain '/' */ /* we don't check for LDAP_DIRSEP since URLs should contain '/' */
if( p[1] == '.' && ( p[2] == '/' || ( p[2] == '.' && p[3] == '/' ))) { if ( p[0] == '/' && p[1] == '/' )
/* skip over false root */ p += 2;
p++;
}
p = ber_strdup( p ); p = ber_strdup( p );
ldap_pvt_hex_unescape( p ); ldap_pvt_hex_unescape( p );