diff --git a/libraries/liblutil/fetch.c b/libraries/liblutil/fetch.c
index 104aa45179678ab031b5467ce31be58a948e81b5..9ddc82dd352b74673c6c3678b7287c61b8ce1304 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" );