]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/search.c
Per ITS#419, don't require SLAPD_RLOOKUPS when HAVE_TCPD
[openldap] / servers / slapd / search.c
index 3e28c17ae7df5729b1b66cfefdf0ed985cede3b1..10e6d67b27601e43d908f32e34f1b7621eaf620d 100644 (file)
@@ -18,6 +18,7 @@
 #include <ac/string.h>
 #include <ac/socket.h>
 
+#include "ldap_pvt.h"
 #include "slap.h"
 
 
@@ -105,7 +106,9 @@ do_search(
                goto return_results;
        }
 
-       if( dn_normalize( base ) == NULL ) {
+       nbase = ch_strdup( base );
+
+       if( dn_normalize( nbase ) == NULL ) {
                send_ldap_result( conn, op, LDAP_INVALID_DN_SYNTAX,
                        NULL, "invalid DN", NULL, NULL );
                rc = -1;
@@ -161,9 +164,6 @@ do_search(
            "conn=%ld op=%d SRCH base=\"%s\" scope=%d filter=\"%s\"\n",
            op->o_connid, op->o_opid, base, scope, fstr );
 
-       nbase = ch_strdup( base );
-       ldap_pvt_str2upper( nbase );
-
        if ( scope == LDAP_SCOPE_BASE ) {
 #if defined( SLAPD_MONITOR_DN )
                if ( strcmp( nbase, SLAPD_MONITOR_DN ) == 0 ) {
@@ -204,6 +204,14 @@ do_search(
                goto return_results;
        }
 
+       /* make sure this backend recongizes critical controls */
+       rc = backend_check_controls( be, conn, op ) ;
+
+       if( rc != LDAP_SUCCESS ) {
+               send_ldap_result( conn, op, rc,
+                       NULL, NULL, NULL, NULL );
+       }
+
        /* deref the base if needed */
        nbase = suffix_alias( be, nbase );