mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-24 00:29:35 -05:00
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.
This commit is contained in:
parent
42f73332bd
commit
ddb9755ba7
8 changed files with 11 additions and 50 deletions
|
|
@ -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:
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Reference in a new issue