From: Kurt Zeilenga Date: Sat, 5 Sep 1998 20:33:22 +0000 (+0000) Subject: Added greg@greg.rim.or.jp's quick hack to allow search with empty search base. X-Git-Tag: PHP3_TOOL_0_0~78 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=95b24ea4821ff64a8c5082b4e8c17063922ae69e;p=openldap Added greg@greg.rim.or.jp's quick hack to allow search with empty search base. Must enable -DLDAP_ALLOW_NULL_SEARCH_BASE to use. --- diff --git a/servers/slapd/backend.c b/servers/slapd/backend.c index c0e32b12d1..8ba8ad8ed5 100644 --- a/servers/slapd/backend.c +++ b/servers/slapd/backend.c @@ -159,7 +159,20 @@ select_backend( char * dn ) dnlen = strlen( dn ); for ( i = 0; i < nbackends; i++ ) { for ( j = 0; backends[i].be_suffix != NULL && - backends[i].be_suffix[j] != NULL; j++ ) { + backends[i].be_suffix[j] != NULL; j++ ) + { +#ifdef LDAP_ALLOW_NULL_SEARCH_BASE + /* Add greg@greg.rim.or.jp + * It's quick hack for cheap client + * Some browser offer a NULL base at ldap_search + */ + if(dnlen == 0) { + Debug( LDAP_DEBUG_TRACE, + "select_backend: use default backend\n", 0, 0, 0 ); + return (&backends[i]); + } +#endif /* LDAP_ALLOW_NULL_SEARCH_BASE + len = strlen( backends[i].be_suffix[j] ); if ( len > dnlen ) {