]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/search.c
When recreating a database from an ldif file created by ldbmcat,
[openldap] / servers / slapd / search.c
index 92a34841bf0914a9578c09fa80dd097a72a367a6..a24a9f68ee60fb9c76061a72b762bb0575171710 100644 (file)
@@ -105,7 +105,12 @@ do_search(
                goto return_results;
        }
 
-       (void) dn_normalize_case( base );
+       if( dn_normalize_case( base ) == NULL ) {
+               send_ldap_result( conn, op, LDAP_INVALID_DN_SYNTAX,
+                       NULL, "invalid DN", NULL, NULL );
+               rc = -1;
+               goto return_results;
+       }
 
        Debug( LDAP_DEBUG_ARGS, "SRCH \"%s\" %d %d", base, scope, deref );
        Debug( LDAP_DEBUG_ARGS, "    %d %d %d\n", sizelimit, timelimit,
@@ -158,14 +163,14 @@ do_search(
        if ( scope == LDAP_SCOPE_BASE ) {
 #if defined( SLAPD_MONITOR_DN )
                if ( strcmp( base, SLAPD_MONITOR_DN ) == 0 ) {
-                       monitor_info( conn, op );
+                       monitor_info( conn, op, attrs, attrsonly );
                        goto return_results;
                }
 #endif
 
 #if defined( SLAPD_CONFIG_DN )
                if ( strcmp( base, SLAPD_CONFIG_DN ) == 0 ) {
-                       config_info( conn, op );
+                       config_info( conn, op, attrs, attrsonly );
                        goto return_results;
                }
 #endif
@@ -195,6 +200,9 @@ do_search(
                goto return_results;
        }
 
+       /* deref the base if needed */
+       base = suffix_alias( be, base );
+
        /* actually do the search and send the result(s) */
        if ( be->be_search ) {
                (*be->be_search)( be, conn, op, base, scope, deref, sizelimit,