Skip to content
Snippets Groups Projects
Commit ddb9755b authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Move handling of operations errors due to submission of

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.
parent 42f73332
No related branches found
No related tags found
No related merge requests found
...@@ -54,13 +54,6 @@ do_add( Connection *conn, Operation *op ) ...@@ -54,13 +54,6 @@ do_add( Connection *conn, Operation *op )
Debug( LDAP_DEBUG_TRACE, "do_add\n", 0, 0, 0 ); 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: * Parse the add request. It looks like this:
* *
......
...@@ -49,14 +49,6 @@ do_compare( ...@@ -49,14 +49,6 @@ do_compare(
Debug( LDAP_DEBUG_TRACE, "do_compare\n", 0, 0, 0 ); 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: * Parse the compare request. It looks like this:
* *
......
...@@ -730,6 +730,16 @@ connection_operation( void *arg_v ) ...@@ -730,6 +730,16 @@ connection_operation( void *arg_v )
num_ops_initiated++; num_ops_initiated++;
ldap_pvt_thread_mutex_unlock( &num_ops_mutex ); 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 ) { switch ( tag ) {
case LDAP_REQ_BIND: case LDAP_REQ_BIND:
rc = do_bind( conn, arg->co_op ); rc = do_bind( conn, arg->co_op );
...@@ -783,6 +793,7 @@ connection_operation( void *arg_v ) ...@@ -783,6 +793,7 @@ connection_operation( void *arg_v )
if( rc == SLAPD_DISCONNECT ) tag = LBER_ERROR; if( rc == SLAPD_DISCONNECT ) tag = LBER_ERROR;
operations_error:
ldap_pvt_thread_mutex_lock( &num_ops_mutex ); ldap_pvt_thread_mutex_lock( &num_ops_mutex );
num_ops_completed++; num_ops_completed++;
ldap_pvt_thread_mutex_unlock( &num_ops_mutex ); ldap_pvt_thread_mutex_unlock( &num_ops_mutex );
...@@ -1075,8 +1086,6 @@ static int connection_op_activate( Connection *conn, Operation *op ) ...@@ -1075,8 +1086,6 @@ static int connection_op_activate( Connection *conn, Operation *op )
arg->co_conn = conn; arg->co_conn = conn;
arg->co_op = op; 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_dn = ch_strdup( tmpdn != NULL ? tmpdn : "" );
arg->co_op->o_ndn = ch_strdup( arg->co_op->o_dn ); arg->co_op->o_ndn = ch_strdup( arg->co_op->o_dn );
(void) dn_normalize( arg->co_op->o_ndn ); (void) dn_normalize( arg->co_op->o_ndn );
......
...@@ -37,14 +37,6 @@ do_delete( ...@@ -37,14 +37,6 @@ do_delete(
Debug( LDAP_DEBUG_TRACE, "do_delete\n", 0, 0, 0 ); 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: * Parse the delete request. It looks like this:
* *
......
...@@ -52,14 +52,6 @@ do_modify( ...@@ -52,14 +52,6 @@ do_modify(
Debug( LDAP_DEBUG_TRACE, "do_modify\n", 0, 0, 0 ); 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: * Parse the modify request. It looks like this:
* *
......
...@@ -56,14 +56,6 @@ do_modrdn( ...@@ -56,14 +56,6 @@ do_modrdn(
Debug( LDAP_DEBUG_TRACE, "do_modrdn\n", 0, 0, 0 ); 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: * Parse the modrdn request. It looks like this:
* *
......
...@@ -44,14 +44,6 @@ do_search( ...@@ -44,14 +44,6 @@ do_search(
Debug( LDAP_DEBUG_TRACE, "do_search\n", 0, 0, 0 ); 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: * Parse the search request. It looks like this:
* *
......
...@@ -957,7 +957,6 @@ typedef struct slap_op { ...@@ -957,7 +957,6 @@ typedef struct slap_op {
ber_tag_t o_tag; /* tag of the request */ ber_tag_t o_tag; /* tag of the request */
time_t o_time; /* time op was initiated */ time_t o_time; /* time op was initiated */
int o_bind_in_progress; /* multi-step bind in progress */
#ifdef SLAP_AUTHZID #ifdef SLAP_AUTHZID
/* should only be used for reporting purposes */ /* should only be used for reporting purposes */
char *o_authc_dn; /* authentication DN */ char *o_authc_dn; /* authentication DN */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment