From: Howard Chu Date: Sat, 1 Dec 2007 19:19:20 +0000 (+0000) Subject: Fix dirsep chars before opening file X-Git-Tag: OPENLDAP_REL_ENG_2_4_9~20^2~367 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6ffbb9b04d9410a6c24f756ceb1b085b6e31b5ce;p=openldap Fix dirsep chars before opening file --- diff --git a/libraries/liblutil/fetch.c b/libraries/liblutil/fetch.c index 104aa45179..9ddc82dd35 100644 --- a/libraries/liblutil/fetch.c +++ b/libraries/liblutil/fetch.c @@ -57,6 +57,14 @@ ldif_open_url( } p = ber_strdup( urlstr ); + + /* But we should convert to LDAP_DIRSEP before use */ + if ( LDAP_DIRSEP[0] != '/' ) { + char *s = p; + while (( s = strchr( s, '/' ))) + *s++ = LDAP_DIRSEP[0]; + } + ldap_pvt_hex_unescape( p ); url = fopen( p, "rb" );