]> git.sur5r.net Git - openldap/commitdiff
Move handling of operations errors due to submission of
authorKurt Zeilenga <kurt@openldap.org>
Thu, 2 Mar 2000 00:59:10 +0000 (00:59 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Thu, 2 Mar 2000 00:59:10 +0000 (00:59 +0000)
non-bind requests while a multi-step SASL bind process
is under to connection.c.  Return LDAP_OPERATIONS_ERROR,
not LDAP_SASL_BIND_IN_PROGRESS.

servers/slapd/add.c
servers/slapd/compare.c
servers/slapd/connection.c
servers/slapd/delete.c
servers/slapd/modify.c
servers/slapd/modrdn.c
servers/slapd/search.c
servers/slapd/slap.h

index e7c6a82f42c89cf1071409ff98dd5aa2b0a06a29..3b20cde293553700fd9554145957ff9eb847f6d8 100644 (file)
@@ -54,13 +54,6 @@ do_add( Connection *conn, Operation *op )
 
        Debug( LDAP_DEBUG_TRACE, "do_add\n", 0, 0, 0 );
 
-       if( op->o_bind_in_progress ) {
-               Debug( LDAP_DEBUG_ANY, "do_add: SASL bind in progress.\n", 0, 0, 0 );
-               send_ldap_result( conn, op, LDAP_SASL_BIND_IN_PROGRESS, NULL,
-                   "SASL bind in progress", NULL, NULL );
-               return LDAP_SASL_BIND_IN_PROGRESS;
-       }
-
        /*
         * Parse the add request.  It looks like this:
         *
index 259698bc46e623dda92d377bfa1c8e7a87ebbb1f..ae6d4e6ea26442cc169f559f11db6f9519293d35 100644 (file)
@@ -49,14 +49,6 @@ do_compare(
 
        Debug( LDAP_DEBUG_TRACE, "do_compare\n", 0, 0, 0 );
 
-       if( op->o_bind_in_progress ) {
-               Debug( LDAP_DEBUG_ANY, "do_compare: SASL bind in progress.\n",
-                       0, 0, 0 );
-               send_ldap_result( conn, op, LDAP_SASL_BIND_IN_PROGRESS,
-                       NULL, "SASL bind in progress", NULL, NULL );
-               return LDAP_SASL_BIND_IN_PROGRESS;
-       }
-
        /*
         * Parse the compare request.  It looks like this:
         *
index 17dcffefd497d251b96c93e2113023aa2fa3697c..7237e5ae0b6d03bc79b0451566dc6639d9625eb9 100644 (file)
@@ -730,6 +730,16 @@ connection_operation( void *arg_v )
        num_ops_initiated++;
        ldap_pvt_thread_mutex_unlock( &num_ops_mutex );
 
+       if( conn->c_bind_in_progress == 1 && tag != LDAP_REQ_BIND ) {
+               Debug( LDAP_DEBUG_ANY,
+                       "connection_operation: SASL bind in progress.\n",
+                       0, 0, 0 );
+               send_ldap_result( conn, arg->co_op, LDAP_OPERATIONS_ERROR,
+                       NULL, "SASL bind in progress", NULL, NULL );
+               rc = LDAP_OPERATIONS_ERROR;
+               goto operations_error;
+       }
+
        switch ( tag ) {
        case LDAP_REQ_BIND:
                rc = do_bind( conn, arg->co_op );
@@ -783,6 +793,7 @@ connection_operation( void *arg_v )
 
        if( rc == SLAPD_DISCONNECT ) tag = LBER_ERROR;
 
+operations_error:
        ldap_pvt_thread_mutex_lock( &num_ops_mutex );
        num_ops_completed++;
        ldap_pvt_thread_mutex_unlock( &num_ops_mutex );
@@ -1075,8 +1086,6 @@ static int connection_op_activate( Connection *conn, Operation *op )
        arg->co_conn = conn;
        arg->co_op = op;
 
-       arg->co_op->o_bind_in_progress = conn->c_bind_in_progress;
-
        arg->co_op->o_dn = ch_strdup( tmpdn != NULL ? tmpdn : "" );
        arg->co_op->o_ndn = ch_strdup( arg->co_op->o_dn );
        (void) dn_normalize( arg->co_op->o_ndn );
index 01d03f82f9f8e68cda13692c9fdf17ecd1276515..b63367214ad1726b40b62f433669ede3ea01dcc3 100644 (file)
@@ -37,14 +37,6 @@ do_delete(
 
        Debug( LDAP_DEBUG_TRACE, "do_delete\n", 0, 0, 0 );
 
-       if( op->o_bind_in_progress ) {
-               Debug( LDAP_DEBUG_ANY, "do_delete: SASL bind in progress.\n",
-                       0, 0, 0 );
-               send_ldap_result( conn, op, LDAP_SASL_BIND_IN_PROGRESS,
-                       NULL, "SASL bind in progress", NULL, NULL );
-               return LDAP_SASL_BIND_IN_PROGRESS;
-       }
-
        /*
         * Parse the delete request.  It looks like this:
         *
index df833bf5734564567542ece50d93311ad87421fb..7f953276a14ef9b9d854670e72dd21382ce70ddb 100644 (file)
@@ -52,14 +52,6 @@ do_modify(
 
        Debug( LDAP_DEBUG_TRACE, "do_modify\n", 0, 0, 0 );
 
-       if( op->o_bind_in_progress ) {
-               Debug( LDAP_DEBUG_ANY, "do_modify: SASL bind in progress.\n",
-                       0, 0, 0 );
-               send_ldap_result( conn, op, LDAP_SASL_BIND_IN_PROGRESS,
-                       NULL, "SASL bind in progress", NULL, NULL );
-               return LDAP_SASL_BIND_IN_PROGRESS;
-       }
-
        /*
         * Parse the modify request.  It looks like this:
         *
index 78b56666d5f9ff10274be16009b057dc1b5ba6dc..c6fd2ae6cf056de0cbd23a66c9cb729394aa12e6 100644 (file)
@@ -56,14 +56,6 @@ do_modrdn(
 
        Debug( LDAP_DEBUG_TRACE, "do_modrdn\n", 0, 0, 0 );
 
-       if( op->o_bind_in_progress ) {
-               Debug( LDAP_DEBUG_ANY, "do_modrdn: SASL bind in progress.\n",
-                       0, 0, 0 );
-               send_ldap_result( conn, op, LDAP_SASL_BIND_IN_PROGRESS,
-                       NULL, "SASL bind in progress", NULL, NULL );
-               return LDAP_SASL_BIND_IN_PROGRESS;
-       }
-
        /*
         * Parse the modrdn request.  It looks like this:
         *
index 5ba446f89940f7a572e3f1c8558b54018b55434a..41784771d1b5fb82c5d904f97e1b4e2efc976f55 100644 (file)
@@ -44,14 +44,6 @@ do_search(
 
        Debug( LDAP_DEBUG_TRACE, "do_search\n", 0, 0, 0 );
 
-       if( op->o_bind_in_progress ) {
-               Debug( LDAP_DEBUG_ANY, "do_search: SASL bind in progress.\n",
-                       0, 0, 0 );
-               send_ldap_result( conn, op, LDAP_SASL_BIND_IN_PROGRESS,
-                       NULL, "SASL bind in progress", NULL, NULL );
-               return LDAP_SASL_BIND_IN_PROGRESS;
-       }
-
        /*
         * Parse the search request.  It looks like this:
         *
index a4dabc824775ab5ccaa00430e418291aa9389417..f0f4a16a68ffa1a43ff8ddd020c795ebf19360c3 100644 (file)
@@ -957,7 +957,6 @@ typedef struct slap_op {
        ber_tag_t       o_tag;          /* tag of the request             */
        time_t          o_time;         /* time op was initiated          */
 
-       int             o_bind_in_progress;     /* multi-step bind in progress */
 #ifdef SLAP_AUTHZID
        /* should only be used for reporting purposes */
        char    *o_authc_dn;    /* authentication DN */