]> git.sur5r.net Git - openldap/commitdiff
Fix dirsep chars before opening file
authorHoward Chu <hyc@openldap.org>
Sat, 1 Dec 2007 19:19:20 +0000 (19:19 +0000)
committerHoward Chu <hyc@openldap.org>
Sat, 1 Dec 2007 19:19:20 +0000 (19:19 +0000)
libraries/liblutil/fetch.c

index 104aa45179678ab031b5467ce31be58a948e81b5..9ddc82dd352b74673c6c3678b7287c61b8ce1304 100644 (file)
@@ -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" );