]> git.sur5r.net Git - openldap/commitdiff
Add NOOP search support.
authorKurt Zeilenga <kurt@openldap.org>
Mon, 2 Sep 2002 17:38:17 +0000 (17:38 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Mon, 2 Sep 2002 17:38:17 +0000 (17:38 +0000)
servers/slapd/controls.c
servers/slapd/result.c

index 53d927004f8f109bfcb9142fb8d165a479ec0351..3450172de731121279228db648140f0235a03fcc 100644 (file)
 
 #include "../../libraries/liblber/lber-int.h"
 
-#define SLAP_CTRL_FRONTEND     0x80000000U
-
-#define SLAP_CTRL_OPFLAGS      0x0000FFFFU
-#define SLAP_CTRL_ABANDON      0x00000001U
-#define SLAP_CTRL_ADD          0x00002002U
-#define SLAP_CTRL_BIND         0x00000004U
-#define SLAP_CTRL_COMPARE      0x00001008U
-#define SLAP_CTRL_DELETE       0x00002010U
-#define SLAP_CTRL_MODIFY       0x00002020U
-#define SLAP_CTRL_RENAME       0x00002040U
-#define SLAP_CTRL_SEARCH       0x00001080U
-#define SLAP_CTRL_UNBIND       0x00000100U
+#define SLAP_CTRL_FRONTEND                     0x80000000U
+#define SLAP_CTRL_FRONTEND_SEARCH      0x01000000U     /* for NOOP */
+
+#define SLAP_CTRL_OPFLAGS                      0x0000FFFFU
+#define SLAP_CTRL_ABANDON                      0x00000001U
+#define SLAP_CTRL_ADD                          0x00002002U
+#define SLAP_CTRL_BIND                         0x00000004U
+#define SLAP_CTRL_COMPARE                      0x00001008U
+#define SLAP_CTRL_DELETE                       0x00002010U
+#define SLAP_CTRL_MODIFY                       0x00002020U
+#define SLAP_CTRL_RENAME                       0x00002040U
+#define SLAP_CTRL_SEARCH                       0x00001080U
+#define SLAP_CTRL_UNBIND                       0x00000100U
 
 #define SLAP_CTRL_INTROGATE    (SLAP_CTRL_COMPARE|SLAP_CTRL_SEARCH)
 #define SLAP_CTRL_UPDATE \
@@ -68,7 +69,7 @@ static struct slap_control {
 #endif
 #ifdef LDAP_CONTROL_NOOP
        { LDAP_CONTROL_NOOP,
-               SLAP_CTRL_UPDATE, NULL,
+               SLAP_CTRL_ACCESS, NULL,
                parseNoOp },
 #endif
 #ifdef LDAP_CONTROL_PAGEDRESULTS_REQUEST
@@ -331,7 +332,13 @@ int get_ctrls(
 
                                if( rc != LDAP_SUCCESS ) goto return_results;
 
-                               if( sc->sc_mask & SLAP_CTRL_FRONTEND ) {
+                               if ( sc->sc_mask & SLAP_CTRL_FRONTEND ) {
+                                       /* kludge to disable backend_control() check */
+                                       c->ldctl_iscritical = 0;
+
+                               } else if ( tagmask == SLAP_CTRL_SEARCH &&
+                                       sc->sc_mask & SLAP_CTRL_FRONTEND_SEARCH )
+                               {
                                        /* kludge to disable backend_control() check */
                                        c->ldctl_iscritical = 0;
                                }
index 863547f206b5646e73b1ffa940486d68ef557151..8df2efcb1bcedd652cc902fe29697d1677800e65 100644 (file)
@@ -1145,7 +1145,7 @@ send_search_entry(
                return( 1 );
        }
 
-       bytes = send_ldap_ber( conn, ber );
+       bytes = op->o_noop ? 0 : send_ldap_ber( conn, ber );
        ber_free_buf( ber );
 
        if ( bytes < 0 ) {
@@ -1301,7 +1301,7 @@ send_search_reference(
                return -1;
        }
 
-       bytes = send_ldap_ber( conn, ber );
+       bytes = op->o_noop ? 0 : send_ldap_ber( conn, ber );
        ber_free_buf( ber );
 
        ldap_pvt_thread_mutex_lock( &num_sent_mutex );