Skip to content
Snippets Groups Projects
Commit d598f7f7 authored by Quanah Gibson-Mount's avatar Quanah Gibson-Mount
Browse files

allow file: URLs without authority spec

URL with authority spec must use absolute path
parent 1d8cee1c
No related branches found
No related tags found
No related merge requests found
......@@ -48,16 +48,15 @@ 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;
/* path must be absolute if authority is present */
if ( p[0] != '/' )
return NULL;
}
p = ber_strdup( p );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment