Minor cleanup

This commit is contained in:
Howard Chu 2003-03-31 07:49:34 +00:00
parent 2fdbc55374
commit fa9bf23501
17 changed files with 142 additions and 148 deletions

View file

@ -103,7 +103,7 @@ do_abandon( Operation *op, SlapReply *rs )
done:
op->oq_abandon.rs_msgid = id;
op->orn_msgid = id;
for ( i = 0; i < nbackends; i++ ) {
op->o_bd = &backends[i];

View file

@ -288,7 +288,7 @@ do_add( Operation *op, SlapReply *rs )
}
#endif /* LDAP_SLAPI */
op->oq_add.rs_e = e;
op->ora_e = e;
if ( (op->o_bd->be_add)( op, rs ) == 0 ) {
#ifdef SLAPD_MULTIMASTER
if ( !repl_user )

View file

@ -650,7 +650,7 @@ be_isroot_pw( Operation *op )
#endif
#endif
result = lutil_passwd( &op->o_bd->be_rootpw, &op->oq_bind.rb_cred, NULL );
result = lutil_passwd( &op->o_bd->be_rootpw, &op->orb_cred, NULL );
#if defined( SLAPD_CRYPT ) || defined( SLAPD_SPASSWD )
#ifdef SLAPD_SPASSWD
@ -686,8 +686,7 @@ backend_unbind( Operation *op, SlapReply *rs )
Slapi_PBlock *pb = op->o_pb;
int rc;
slapi_x_connection_set_pb( pb, op->o_conn );
slapi_x_operation_set_pb( pb, op );
slapi_x_pblock_set_operation( pb, op );
#endif /* defined( LDAP_SLAPI ) */
for ( i = 0; i < nbackends; i++ ) {
@ -1262,13 +1261,13 @@ Attribute *backend_operational(
* and the backend supports specific operational attributes,
* add them to the attribute list
*/
if ( opattrs || ( op->oq_search.rs_attrs &&
ad_inlist( slap_schema.si_ad_subschemaSubentry, op->oq_search.rs_attrs )) ) {
if ( opattrs || ( op->ors_attrs &&
ad_inlist( slap_schema.si_ad_subschemaSubentry, op->ors_attrs )) ) {
*ap = slap_operational_subschemaSubentry( op->o_bd );
ap = &(*ap)->a_next;
}
if ( ( opattrs || op->oq_search.rs_attrs ) && op->o_bd && op->o_bd->be_operational != NULL ) {
if ( ( opattrs || op->ors_attrs ) && op->o_bd && op->o_bd->be_operational != NULL ) {
( void )op->o_bd->be_operational( op, rs, opattrs, ap );
}

View file

@ -284,11 +284,11 @@ glue_back_search ( Operation *op, SlapReply *rs )
gs.prevcb = op->o_callback;
if (op->oq_search.rs_tlimit) {
stoptime = slap_get_time () + op->oq_search.rs_tlimit;
if (op->ors_tlimit) {
stoptime = slap_get_time () + op->ors_tlimit;
}
switch (op->oq_search.rs_scope) {
switch (op->ors_scope) {
case LDAP_SCOPE_BASE:
op->o_bd = glue_back_select (b0, op->o_req_ndn.bv_val);
@ -304,9 +304,9 @@ glue_back_search ( Operation *op, SlapReply *rs )
case LDAP_SCOPE_SUBTREE:
op->o_callback = &cb;
rs->sr_err = gs.err = LDAP_UNWILLING_TO_PERFORM;
scope0 = op->oq_search.rs_scope;
slimit0 = op->oq_search.rs_slimit;
tlimit0 = op->oq_search.rs_tlimit;
scope0 = op->ors_scope;
slimit0 = op->ors_slimit;
tlimit0 = op->ors_tlimit;
dn = op->o_req_dn;
ndn = op->o_req_ndn;
@ -317,15 +317,15 @@ glue_back_search ( Operation *op, SlapReply *rs )
if (!gi->n[i].be || !gi->n[i].be->be_search)
continue;
if (tlimit0) {
op->oq_search.rs_tlimit = stoptime - slap_get_time ();
if (op->oq_search.rs_tlimit <= 0) {
op->ors_tlimit = stoptime - slap_get_time ();
if (op->ors_tlimit <= 0) {
rs->sr_err = gs.err = LDAP_TIMELIMIT_EXCEEDED;
break;
}
}
if (slimit0) {
op->oq_search.rs_slimit = slimit0 - gs.nentries;
if (op->oq_search.rs_slimit <= 0) {
op->ors_slimit = slimit0 - gs.nentries;
if (op->ors_slimit <= 0) {
rs->sr_err = gs.err = LDAP_SIZELIMIT_EXCEEDED;
break;
}
@ -340,7 +340,7 @@ glue_back_search ( Operation *op, SlapReply *rs )
op->o_bd = gi->n[i].be;
if (scope0 == LDAP_SCOPE_ONELEVEL &&
dn_match(&gi->n[i].pdn, &ndn)) {
op->oq_search.rs_scope = LDAP_SCOPE_BASE;
op->ors_scope = LDAP_SCOPE_BASE;
op->o_req_dn = op->o_bd->be_suffix[0];
op->o_req_ndn = op->o_bd->be_nsuffix[0];
rs->sr_err = op->o_bd->be_search(op, rs);
@ -371,9 +371,9 @@ glue_back_search ( Operation *op, SlapReply *rs )
}
}
end_of_loop:;
op->oq_search.rs_scope = scope0;
op->oq_search.rs_slimit = slimit0;
op->oq_search.rs_tlimit = tlimit0;
op->ors_scope = scope0;
op->ors_slimit = slimit0;
op->ors_tlimit = tlimit0;
op->o_req_dn = dn;
op->o_req_ndn = ndn;

View file

@ -121,7 +121,7 @@ do_bind(
op->o_protocol = version;
if( method != LDAP_AUTH_SASL ) {
tag = ber_scanf( ber, /*{*/ "m}", &op->oq_bind.rb_cred );
tag = ber_scanf( ber, /*{*/ "m}", &op->orb_cred );
} else {
tag = ber_scanf( ber, "{m" /*}*/, &mech );
@ -131,11 +131,11 @@ do_bind(
tag = ber_peek_tag( ber, &len );
if ( tag == LDAP_TAG_LDAPCRED ) {
tag = ber_scanf( ber, "m", &op->oq_bind.rb_cred );
tag = ber_scanf( ber, "m", &op->orb_cred );
} else {
tag = LDAP_TAG_LDAPCRED;
op->oq_bind.rb_cred.bv_val = NULL;
op->oq_bind.rb_cred.bv_len = 0;
op->orb_cred.bv_val = NULL;
op->orb_cred.bv_len = 0;
}
if ( tag != LBER_ERROR ) {
@ -292,8 +292,8 @@ do_bind(
ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex );
if( rs->sr_err == LDAP_SUCCESS ) {
op->o_conn->c_dn = op->oq_bind.rb_edn;
if( op->oq_bind.rb_edn.bv_len != 0 ) {
op->o_conn->c_dn = op->orb_edn;
if( op->orb_edn.bv_len != 0 ) {
/* edn is always normalized already */
ber_dupbv( &op->o_conn->c_ndn, &op->o_conn->c_dn );
}
@ -302,9 +302,9 @@ do_bind(
op->o_conn->c_sasl_bind_mech.bv_len = 0;
op->o_conn->c_sasl_bind_in_progress = 0;
op->o_conn->c_sasl_ssf = op->oq_bind.rb_ssf;
if( op->oq_bind.rb_ssf > op->o_conn->c_ssf ) {
op->o_conn->c_ssf = op->oq_bind.rb_ssf;
op->o_conn->c_sasl_ssf = op->orb_ssf;
if( op->orb_ssf > op->o_conn->c_ssf ) {
op->o_conn->c_ssf = op->orb_ssf;
}
if( op->o_conn->c_dn.bv_len != 0 ) {
@ -318,20 +318,20 @@ do_bind(
"conn=%lu op=%lu BIND dn=\"%s\" mech=%s ssf=%d\n",
op->o_connid, op->o_opid,
op->o_conn->c_dn.bv_val ? op->o_conn->c_dn.bv_val : "<empty>",
op->o_conn->c_authmech.bv_val, op->oq_bind.rb_ssf );
op->o_conn->c_authmech.bv_val, op->orb_ssf );
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, DETAIL1,
"do_bind: SASL/%s bind: dn=\"%s\" ssf=%d\n",
op->o_conn->c_authmech.bv_val,
op->o_conn->c_dn.bv_val ? op->o_conn->c_dn.bv_val : "<empty>",
op->oq_bind.rb_ssf );
op->orb_ssf );
#else
Debug( LDAP_DEBUG_TRACE,
"do_bind: SASL/%s bind: dn=\"%s\" ssf=%d\n",
op->o_conn->c_authmech.bv_val,
op->o_conn->c_dn.bv_val ? op->o_conn->c_dn.bv_val : "<empty>",
op->oq_bind.rb_ssf );
op->orb_ssf );
#endif
} else if ( rs->sr_err == LDAP_SASL_BIND_IN_PROGRESS ) {
@ -366,10 +366,10 @@ do_bind(
if ( method == LDAP_AUTH_SIMPLE ) {
/* accept "anonymous" binds */
if ( op->oq_bind.rb_cred.bv_len == 0 || op->o_req_ndn.bv_len == 0 ) {
if ( op->orb_cred.bv_len == 0 || op->o_req_ndn.bv_len == 0 ) {
rs->sr_err = LDAP_SUCCESS;
if( op->oq_bind.rb_cred.bv_len &&
if( op->orb_cred.bv_len &&
!( global_allows & SLAP_ALLOW_BIND_ANON_CRED ))
{
/* cred is not empty, disallow */
@ -517,7 +517,7 @@ do_bind(
slapi_x_pblock_set_operation( pb, op );
slapi_pblock_set( pb, SLAPI_BIND_TARGET, (void *)dn.bv_val );
slapi_pblock_set( pb, SLAPI_BIND_METHOD, (void *)method );
slapi_pblock_set( pb, SLAPI_BIND_CREDENTIALS, (void *)&op->oq_bind.rb_cred );
slapi_pblock_set( pb, SLAPI_BIND_CREDENTIALS, (void *)&op->orb_cred );
slapi_pblock_set( pb, SLAPI_MANAGEDSAIT, (void *)(0) );
rs->sr_err = doPluginFNs( op->o_bd, SLAPI_PLUGIN_PRE_BIND_FN, pb );
@ -536,14 +536,14 @@ do_bind(
if ( slapi_pblock_get( pb, SLAPI_RESULT_CODE, (void *)&ldapRc ) != 0 )
ldapRc = LDAP_OTHER;
op->oq_bind.rb_edn.bv_val = NULL;
op->oq_bind.rb_edn.bv_len = 0;
op->orb_edn.bv_val = NULL;
op->orb_edn.bv_len = 0;
if ( rs->sr_err != SLAPI_BIND_FAIL && ldapRc == LDAP_SUCCESS ) {
/* Set the new connection DN. */
if ( rs->sr_err != SLAPI_BIND_ANONYMOUS ) {
slapi_pblock_get( pb, SLAPI_CONN_DN, (void *)&op->oq_bind.rb_edn.bv_val );
slapi_pblock_get( pb, SLAPI_CONN_DN, (void *)&op->orb_edn.bv_val );
}
rs->sr_err = dnPrettyNormal( NULL, &op->oq_bind.rb_edn, &op->o_req_dn, &op->o_req_ndn );
rs->sr_err = dnPrettyNormal( NULL, &op->orb_edn, &op->o_req_dn, &op->o_req_ndn );
ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex );
op->o_conn->c_dn = op->o_req_dn;
op->o_conn->c_ndn = op->o_req_ndn;
@ -575,7 +575,7 @@ do_bind(
#endif /* defined( LDAP_SLAPI ) */
if ( op->o_bd->be_bind ) {
op->oq_bind.rb_method = method;
op->orb_method = method;
rs->sr_err = (op->o_bd->be_bind)( op, rs );
if ( rs->sr_err == 0 ) {
@ -585,8 +585,8 @@ do_bind(
op->o_conn->c_authz_backend = op->o_bd;
}
if(op->oq_bind.rb_edn.bv_len) {
op->o_conn->c_dn = op->oq_bind.rb_edn;
if(op->orb_edn.bv_len) {
op->o_conn->c_dn = op->orb_edn;
} else {
op->o_conn->c_dn = op->o_req_dn;
op->o_req_dn.bv_val = NULL;
@ -624,8 +624,8 @@ do_bind(
/* send this here to avoid a race condition */
send_ldap_result( op, rs );
} else if (op->oq_bind.rb_edn.bv_val != NULL) {
free( op->oq_bind.rb_edn.bv_val );
} else if (op->orb_edn.bv_val != NULL) {
free( op->orb_edn.bv_val );
}
} else {

View file

@ -30,14 +30,14 @@ int cancel_extop( Operation *op, SlapReply *rs )
BerElement *ber;
int i;
assert( ber_bvcmp( &slap_EXOP_CANCEL, &op->oq_extended.rs_reqoid ) == 0 );
assert( ber_bvcmp( &slap_EXOP_CANCEL, &op->ore_reqoid ) == 0 );
if ( op->oq_extended.rs_reqdata == NULL ) {
if ( op->ore_reqdata == NULL ) {
rs->sr_text = "no message ID supplied";
return LDAP_PROTOCOL_ERROR;
}
ber = ber_init( op->oq_extended.rs_reqdata );
ber = ber_init( op->ore_reqdata );
if ( ber == NULL ) {
rs->sr_text = "internal error";
return LDAP_OTHER;

View file

@ -38,12 +38,10 @@ do_compare(
)
{
Entry *entry = NULL;
Entry *fentry = NULL;
struct berval dn = { 0, NULL };
struct berval desc = { 0, NULL };
struct berval value = { 0, NULL };
AttributeAssertion ava = { NULL, { 0, NULL } };
Backend *be;
int manageDSAit;
#ifdef LDAP_SLAPI
@ -172,8 +170,6 @@ do_compare(
goto cleanup;
}
fentry = entry;
} else if ( bvmatch( &op->o_req_ndn, &global_schemandn ) ) {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, ARGS,
@ -202,12 +198,11 @@ do_compare(
rs->sr_err = 0;
goto cleanup;
}
fentry = entry;
}
if( entry ) {
rs->sr_err = compare_entry( op, entry, &ava );
if( fentry) entry_free( fentry );
entry_free( entry );
send_ldap_result( op, rs );
@ -289,7 +284,7 @@ do_compare(
#endif /* defined( LDAP_SLAPI ) */
if ( op->o_bd->be_compare ) {
op->oq_compare.rs_ava = &ava;
op->orc_ava = &ava;
op->o_bd->be_compare( op, rs );
} else {
send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,

View file

@ -557,11 +557,11 @@ int get_ctrls(
break;
case LDAP_REQ_EXTENDED:
tagmask=~0L;
assert( op->oq_extended.rs_reqoid.bv_val != NULL );
assert( op->ore_reqoid.bv_val != NULL );
if( sc->sc_extendedops != NULL ) {
int i;
for( i=0; sc->sc_extendedops[i] != NULL; i++ ) {
if( strcmp( op->oq_extended.rs_reqoid.bv_val, sc->sc_extendedops[i] )
if( strcmp( op->ore_reqoid.bv_val, sc->sc_extendedops[i] )
== 0 )
{
tagmask=0L;

View file

@ -135,7 +135,7 @@ do_extended(
goto done;
}
if ( ber_scanf( op->o_ber, "{m" /*}*/, &op->oq_extended.rs_reqoid ) == LBER_ERROR ) {
if ( ber_scanf( op->o_ber, "{m" /*}*/, &op->ore_reqoid ) == LBER_ERROR ) {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, ERR, "do_extended: conn %d ber_scanf failed\n",
op->o_connid, 0, 0 );
@ -148,19 +148,19 @@ do_extended(
}
#ifdef LDAP_SLAPI
getPluginFunc( &op->oq_extended.rs_reqoid, &funcAddr ); /* NS-SLAPI extended operation */
if( !funcAddr && !(ext = find_extop(supp_ext_list, &op->oq_extended.rs_reqoid )))
getPluginFunc( &op->ore_reqoid, &funcAddr ); /* NS-SLAPI extended operation */
if( !funcAddr && !(ext = find_extop(supp_ext_list, &op->ore_reqoid )))
#else
if( !(ext = find_extop(supp_ext_list, &op->oq_extended.rs_reqoid )))
if( !(ext = find_extop(supp_ext_list, &op->ore_reqoid )))
#endif
{
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, ERR,
"do_extended: conn %d unsupported operation \"%s\"\n",
op->o_connid, op->oq_extended.rs_reqoid.bv_val, 0 );
op->o_connid, op->ore_reqoid.bv_val, 0 );
#else
Debug( LDAP_DEBUG_ANY, "do_extended: unsupported operation \"%s\"\n",
op->oq_extended.rs_reqoid.bv_val, 0 ,0 );
op->ore_reqoid.bv_val, 0 ,0 );
#endif
send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR,
"unsupported extended operation" );
@ -204,16 +204,16 @@ do_extended(
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, DETAIL1,
"do_extended: conn %d oid=%s\n.", op->o_connid, op->oq_extended.rs_reqoid.bv_val, 0 );
"do_extended: conn %d oid=%s\n.", op->o_connid, op->ore_reqoid.bv_val, 0 );
#else
Debug( LDAP_DEBUG_ARGS, "do_extended: oid=%s\n", op->oq_extended.rs_reqoid.bv_val, 0 ,0 );
Debug( LDAP_DEBUG_ARGS, "do_extended: oid=%s\n", op->ore_reqoid.bv_val, 0 ,0 );
#endif
#if defined(LDAP_SLAPI)
if (ext != NULL) { /* OpenLDAP extended operation */
#endif /* defined(LDAP_SLAPI) */
if (reqdata.bv_val) op->oq_extended.rs_reqdata = &reqdata;
if (reqdata.bv_val) op->ore_reqdata = &reqdata;
rs->sr_err = (ext->ext_main)( op, rs );
if( rs->sr_err != SLAPD_ABANDON ) {
@ -240,7 +240,7 @@ do_extended(
} else { /* start of Netscape extended operation */
rs->sr_err = slapi_pblock_set( pb, SLAPI_EXT_OP_REQ_OID,
(void *)op->oq_extended.rs_reqoid.bv_val);
(void *)op->ore_reqoid.bv_val);
if ( rs->sr_err != LDAP_SUCCESS ) {
rs->sr_err = LDAP_OTHER;
goto done;
@ -377,7 +377,7 @@ whoami_extop (
{
struct berval *bv;
if ( op->oq_extended.rs_reqdata != NULL ) {
if ( op->ore_reqdata != NULL ) {
/* no request data should be provided */
rs->sr_text = "no request data expected";
return LDAP_PROTOCOL_ERROR;

View file

@ -407,7 +407,7 @@ do_modify(
}
}
op->oq_modify.rs_modlist = modlist;
op->orm_modlist = modlist;
if ( (op->o_bd->be_modify)( op, rs ) == 0
#ifdef SLAPD_MULTIMASTER
&& !repl_user

View file

@ -133,8 +133,8 @@ do_modrdn(
rs->sr_err = SLAPD_DISCONNECT;
goto cleanup;
}
op->oq_modrdn.rs_newSup = &pnewSuperior;
op->oq_modrdn.rs_nnewSup = &nnewSuperior;
op->orr_newSup = &pnewSuperior;
op->orr_nnewSup = &nnewSuperior;
}
#ifdef NEW_LOGGING
@ -216,7 +216,7 @@ do_modrdn(
/* FIXME: should have/use rdnPretty / rdnNormalize routines */
rs->sr_err = dnPrettyNormal( NULL, &newrdn, &op->oq_modrdn.rs_newrdn, &op->oq_modrdn.rs_nnewrdn );
rs->sr_err = dnPrettyNormal( NULL, &newrdn, &op->orr_newrdn, &op->orr_nnewrdn );
if( rs->sr_err != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, INFO,
@ -230,20 +230,20 @@ do_modrdn(
goto cleanup;
}
if( rdnValidate( &op->oq_modrdn.rs_newrdn ) != LDAP_SUCCESS ) {
if( rdnValidate( &op->orr_newrdn ) != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, ERR,
"do_modrdn: invalid rdn (%s).\n", op->oq_modrdn.rs_newrdn.bv_val, 0, 0 );
"do_modrdn: invalid rdn (%s).\n", op->orr_newrdn.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY, "do_modrdn: invalid rdn (%s)\n",
op->oq_modrdn.rs_newrdn.bv_val, 0, 0 );
op->orr_newrdn.bv_val, 0, 0 );
#endif
send_ldap_error( op, rs, LDAP_INVALID_DN_SYNTAX, "invalid new RDN" );
goto cleanup;
}
if( op->oq_modrdn.rs_newSup ) {
if( op->orr_newSup ) {
rs->sr_err = dnPrettyNormal( NULL, &newSuperior, &pnewSuperior,
&nnewSuperior );
if( rs->sr_err != LDAP_SUCCESS ) {
@ -297,7 +297,7 @@ do_modrdn(
/* Make sure that the entry being changed and the newSuperior are in
* the same backend, otherwise we return an error.
*/
if( op->oq_modrdn.rs_newSup ) {
if( op->orr_newSup ) {
newSuperior_be = select_backend( &nnewSuperior, 0, 0 );
if ( newSuperior_be != op->o_bd ) {
@ -350,7 +350,7 @@ do_modrdn(
if ( !op->o_bd->be_update_ndn.bv_len || repl_user )
#endif
{
op->oq_modrdn.rs_deleteoldrdn = deloldrdn;
op->orr_deleteoldrdn = deloldrdn;
if ( (op->o_bd->be_modrdn)( op, rs ) == 0
#ifdef SLAPD_MULTIMASTER
&& ( !op->o_bd->be_update_ndn.bv_len || !repl_user )
@ -393,8 +393,8 @@ cleanup:
free( op->o_req_dn.bv_val );
free( op->o_req_ndn.bv_val );
free( op->oq_modrdn.rs_newrdn.bv_val );
free( op->oq_modrdn.rs_nnewrdn.bv_val );
free( op->orr_newrdn.bv_val );
free( op->orr_nnewrdn.bv_val );
if ( pnewSuperior.bv_val ) free( pnewSuperior.bv_val );
if ( nnewSuperior.bv_val ) free( nnewSuperior.bv_val );
@ -415,7 +415,7 @@ slap_modrdn2mods(
int a_cnt, d_cnt;
assert( new_rdn != NULL );
assert( !op->oq_modrdn.rs_deleteoldrdn || old_rdn != NULL );
assert( !op->orr_deleteoldrdn || old_rdn != NULL );
/* Add new attribute values to the entry */
for ( a_cnt = 0; new_rdn[0][a_cnt]; a_cnt++ ) {
@ -489,7 +489,7 @@ slap_modrdn2mods(
}
/* Remove old rdn value if required */
if ( op->oq_modrdn.rs_deleteoldrdn ) {
if ( op->orr_deleteoldrdn ) {
for ( d_cnt = 0; old_rdn[0][d_cnt]; d_cnt++ ) {
AttributeDescription *desc = NULL;
Modifications *mod_tmp;

View file

@ -23,7 +23,7 @@ int passwd_extop(
Operation *op,
SlapReply *rs )
{
assert( ber_bvcmp( &slap_EXOP_MODIFY_PASSWD, &op->oq_extended.rs_reqoid ) == 0 );
assert( ber_bvcmp( &slap_EXOP_MODIFY_PASSWD, &op->ore_reqoid ) == 0 );
if( op->o_dn.bv_len == 0 ) {
rs->sr_text = "only authenticated users may change passwords";

View file

@ -207,7 +207,7 @@ replog( Operation *op )
/* assume change parameter is a Modfications* */
/* fall thru */
case LDAP_REQ_MODIFY:
for ( ml = op->oq_modify.rs_modlist; ml != NULL; ml = ml->sml_next ) {
for ( ml = op->orm_modlist; ml != NULL; ml = ml->sml_next ) {
int is_in, exclude;
is_in = ad_inlist( ml->sml_desc, op->o_bd->be_replica[i]->ri_attrs );
@ -228,7 +228,7 @@ replog( Operation *op )
}
break;
case LDAP_REQ_ADD:
for ( a = op->oq_add.rs_e->e_attrs; a != NULL; a = a->a_next ) {
for ( a = op->ora_e->e_attrs; a != NULL; a = a->a_next ) {
int is_in, exclude;
is_in = ad_inlist( a->a_desc, op->o_bd->be_replica[i]->ri_attrs );
@ -279,7 +279,7 @@ replog1(
case LDAP_REQ_MODIFY:
fprintf( fp, "changetype: modify\n" );
ml = first ? first : op->oq_modify.rs_modlist;
ml = first ? first : op->orm_modlist;
for ( ; ml != NULL; ml = ml->sml_next ) {
char *type;
if ( ri && ri->ri_attrs ) {
@ -311,7 +311,7 @@ replog1(
case LDAP_REQ_ADD:
fprintf( fp, "changetype: add\n" );
a = first ? first : op->oq_add.rs_e->e_attrs;
a = first ? first : op->ora_e->e_attrs;
for ( ; a != NULL; a=a->a_next ) {
if ( ri && ri->ri_attrs ) {
int is_in = ad_inlist( a->a_desc, ri->ri_attrs );
@ -356,10 +356,10 @@ replog1(
case LDAP_REQ_MODRDN:
fprintf( fp, "changetype: modrdn\n" );
fprintf( fp, "newrdn: %s\n", op->oq_modrdn.rs_newrdn.bv_val );
fprintf( fp, "deleteoldrdn: %d\n", op->oq_modrdn.rs_deleteoldrdn ? 1 : 0 );
if( op->oq_modrdn.rs_newSup != NULL ) {
fprintf( fp, "newsuperior: %s\n", op->oq_modrdn.rs_newSup->bv_val );
fprintf( fp, "newrdn: %s\n", op->orr_newrdn.bv_val );
fprintf( fp, "deleteoldrdn: %d\n", op->orr_deleteoldrdn ? 1 : 0 );
if( op->orr_newSup != NULL ) {
fprintf( fp, "newsuperior: %s\n", op->orr_newSup->bv_val );
}
}
fprintf( fp, "\n" );

View file

@ -609,11 +609,11 @@ slap_send_search_entry( Operation *op, SlapReply *rs )
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, ENTRY,
"send_search_entry: conn %lu dn=\"%s\"%s\n",
op->o_connid, rs->sr_entry->e_name.bv_val, op->oq_search.rs_attrsonly ? " (attrsOnly)" : "" );
op->o_connid, rs->sr_entry->e_name.bv_val, op->ors_attrsonly ? " (attrsOnly)" : "" );
#else
Debug( LDAP_DEBUG_TRACE,
"=> send_search_entry: dn=\"%s\"%s\n",
rs->sr_entry->e_name.bv_val, op->oq_search.rs_attrsonly ? " (attrsOnly)" : "", 0 );
rs->sr_entry->e_name.bv_val, op->ors_attrsonly ? " (attrsOnly)" : "", 0 );
#endif
if ( ! access_allowed( op, rs->sr_entry, ad_entry, NULL, ACL_READ, NULL ) )
@ -789,7 +789,7 @@ slap_send_search_entry( Operation *op, SlapReply *rs )
goto error_return;
}
if ( ! op->oq_search.rs_attrsonly ) {
if ( ! op->ors_attrsonly ) {
for ( i = 0; a->a_vals[i].bv_val != NULL; i++ ) {
if ( ! access_allowed( op, rs->sr_entry,
desc, &a->a_vals[i], ACL_READ, &acl_state ) )
@ -982,7 +982,7 @@ slap_send_search_entry( Operation *op, SlapReply *rs )
goto error_return;
}
if ( ! op->oq_search.rs_attrsonly ) {
if ( ! op->ors_attrsonly ) {
for ( i = 0; a->a_vals[i].bv_val != NULL; i++ ) {
if ( ! access_allowed( op, rs->sr_entry,
desc, &a->a_vals[i], ACL_READ, &acl_state ) )
@ -1054,7 +1054,7 @@ slap_send_search_entry( Operation *op, SlapReply *rs )
*/
ctx.cac_pb = op->o_pb;
ctx.cac_attrs = rs->sr_attrs;
ctx.cac_attrsonly = op->oq_search.rs_attrsonly;
ctx.cac_attrsonly = op->ors_attrsonly;
ctx.cac_userattrs = userattrs;
ctx.cac_opattrs = opattrs;
ctx.cac_acl_state = acl_state;

View file

@ -1312,14 +1312,14 @@ int slap_sasl_bind( Operation *op, SlapReply *rs )
op->o_req_dn.bv_len ? op->o_req_dn.bv_val : "",
op->o_conn->c_sasl_bind_in_progress ? "<continuing>" :
op->o_conn->c_sasl_bind_mech.bv_val,
op->oq_bind.rb_cred.bv_len );
op->orb_cred.bv_len );
#else
Debug(LDAP_DEBUG_ARGS,
"==> sasl_bind: dn=\"%s\" mech=%s datalen=%ld\n",
op->o_req_dn.bv_len ? op->o_req_dn.bv_val : "",
op->o_conn->c_sasl_bind_in_progress ? "<continuing>" :
op->o_conn->c_sasl_bind_mech.bv_val,
op->oq_bind.rb_cred.bv_len );
op->orb_cred.bv_len );
#endif
@ -1344,12 +1344,12 @@ int slap_sasl_bind( Operation *op, SlapReply *rs )
if ( !op->o_conn->c_sasl_bind_in_progress ) {
sc = START( ctx,
op->o_conn->c_sasl_bind_mech.bv_val,
op->oq_bind.rb_cred.bv_val, op->oq_bind.rb_cred.bv_len,
op->orb_cred.bv_val, op->orb_cred.bv_len,
(SASL_CONST char **)&response.bv_val, &reslen, &rs->sr_text );
} else {
sc = STEP( ctx,
op->oq_bind.rb_cred.bv_val, op->oq_bind.rb_cred.bv_len,
op->orb_cred.bv_val, op->orb_cred.bv_len,
(SASL_CONST char **)&response.bv_val, &reslen, &rs->sr_text );
}
@ -1358,16 +1358,16 @@ int slap_sasl_bind( Operation *op, SlapReply *rs )
if ( sc == SASL_OK ) {
sasl_ssf_t *ssf = NULL;
op->oq_bind.rb_edn = op->o_conn->c_sasl_dn;
op->orb_edn = op->o_conn->c_sasl_dn;
op->o_conn->c_sasl_dn.bv_val = NULL;
op->o_conn->c_sasl_dn.bv_len = 0;
rs->sr_err = LDAP_SUCCESS;
(void) sasl_getprop( ctx, SASL_SSF, (void *)&ssf );
op->oq_bind.rb_ssf = ssf ? *ssf : 0;
op->orb_ssf = ssf ? *ssf : 0;
if( op->oq_bind.rb_ssf ) {
if( op->orb_ssf ) {
ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex );
op->o_conn->c_sasl_layers++;
ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );

View file

@ -79,15 +79,15 @@ do_search(
/* baseObject, scope, derefAliases, sizelimit, timelimit, attrsOnly */
if ( ber_scanf( op->o_ber, "{miiiib" /*}*/,
&base, &op->oq_search.rs_scope, &op->oq_search.rs_deref, &op->oq_search.rs_slimit,
&op->oq_search.rs_tlimit, &op->oq_search.rs_attrsonly ) == LBER_ERROR )
&base, &op->ors_scope, &op->ors_deref, &op->ors_slimit,
&op->ors_tlimit, &op->ors_attrsonly ) == LBER_ERROR )
{
send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding error" );
rs->sr_err = SLAPD_DISCONNECT;
goto return_results;
}
switch( op->oq_search.rs_scope ) {
switch( op->ors_scope ) {
case LDAP_SCOPE_BASE:
case LDAP_SCOPE_ONELEVEL:
case LDAP_SCOPE_SUBTREE:
@ -97,7 +97,7 @@ do_search(
goto return_results;
}
switch( op->oq_search.rs_deref ) {
switch( op->ors_deref ) {
case LDAP_DEREF_NEVER:
case LDAP_DEREF_FINDING:
case LDAP_DEREF_SEARCHING:
@ -124,18 +124,18 @@ do_search(
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, ARGS, "SRCH \"%s\" %d %d",
base.bv_val, op->oq_search.rs_scope, op->oq_search.rs_deref );
base.bv_val, op->ors_scope, op->ors_deref );
LDAP_LOG( OPERATION, ARGS, " %d %d %d\n",
op->oq_search.rs_slimit, op->oq_search.rs_tlimit, op->oq_search.rs_attrsonly);
op->ors_slimit, op->ors_tlimit, op->ors_attrsonly);
#else
Debug( LDAP_DEBUG_ARGS, "SRCH \"%s\" %d %d",
base.bv_val, op->oq_search.rs_scope, op->oq_search.rs_deref );
base.bv_val, op->ors_scope, op->ors_deref );
Debug( LDAP_DEBUG_ARGS, " %d %d %d\n",
op->oq_search.rs_slimit, op->oq_search.rs_tlimit, op->oq_search.rs_attrsonly);
op->ors_slimit, op->ors_tlimit, op->ors_attrsonly);
#endif
/* filter - returns a "normalized" version */
rs->sr_err = get_filter( op->o_conn, op->o_ber, &op->oq_search.rs_filter, &rs->sr_text );
rs->sr_err = get_filter( op->o_conn, op->o_ber, &op->ors_filter, &rs->sr_text );
if( rs->sr_err != LDAP_SUCCESS ) {
if( rs->sr_err == SLAPD_DISCONNECT ) {
rs->sr_err = LDAP_PROTOCOL_ERROR;
@ -145,30 +145,30 @@ do_search(
}
goto return_results;
}
filter2bv( op->oq_search.rs_filter, &op->oq_search.rs_filterstr );
filter2bv( op->ors_filter, &op->ors_filterstr );
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, ARGS,
"do_search: conn %d filter: %s\n",
op->o_connid, op->oq_search.rs_filterstr.bv_len ? op->oq_search.rs_filterstr.bv_val : "empty", 0 );
op->o_connid, op->ors_filterstr.bv_len ? op->ors_filterstr.bv_val : "empty", 0 );
#else
Debug( LDAP_DEBUG_ARGS, " filter: %s\n",
op->oq_search.rs_filterstr.bv_len ? op->oq_search.rs_filterstr.bv_val : "empty", 0, 0 );
op->ors_filterstr.bv_len ? op->ors_filterstr.bv_val : "empty", 0, 0 );
#endif
/* attributes */
siz = sizeof(AttributeName);
off = 0;
if ( ber_scanf( op->o_ber, "{M}}", &op->oq_search.rs_attrs, &siz, off ) == LBER_ERROR ) {
if ( ber_scanf( op->o_ber, "{M}}", &op->ors_attrs, &siz, off ) == LBER_ERROR ) {
send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding attrs error" );
rs->sr_err = SLAPD_DISCONNECT;
goto return_results;
}
for ( i=0; i<siz; i++ ) {
const char *dummy; /* ignore msgs from bv2ad */
op->oq_search.rs_attrs[i].an_desc = NULL;
op->oq_search.rs_attrs[i].an_oc = NULL;
slap_bv2ad(&op->oq_search.rs_attrs[i].an_name, &op->oq_search.rs_attrs[i].an_desc, &dummy);
op->ors_attrs[i].an_desc = NULL;
op->ors_attrs[i].an_oc = NULL;
slap_bv2ad(&op->ors_attrs[i].an_name, &op->ors_attrs[i].an_desc, &dummy);
}
if( get_ctrls( op, rs, 1 ) != LDAP_SUCCESS ) {
@ -194,9 +194,9 @@ do_search(
for ( i = 0; i<siz; i++ ) {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, ARGS,
"do_search: %s", op->oq_search.rs_attrs[i].an_name.bv_val, 0, 0 );
"do_search: %s", op->ors_attrs[i].an_name.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_ARGS, " %s", op->oq_search.rs_attrs[i].an_name.bv_val, 0, 0 );
Debug( LDAP_DEBUG_ARGS, " %s", op->ors_attrs[i].an_name.bv_val, 0, 0 );
#endif
}
}
@ -213,10 +213,10 @@ do_search(
Statslog( LDAP_DEBUG_STATS,
"conn=%lu op=%lu SRCH base=\"%s\" scope=%d filter=\"%s\"\n",
op->o_connid, op->o_opid, op->o_req_dn.bv_val, op->oq_search.rs_scope, op->oq_search.rs_filterstr.bv_val );
op->o_connid, op->o_opid, op->o_req_dn.bv_val, op->ors_scope, op->ors_filterstr.bv_val );
for ( i = 0; i<siz; i++ ) {
alen = op->oq_search.rs_attrs[i].an_name.bv_len;
alen = op->ors_attrs[i].an_name.bv_len;
if (alen >= sizeof(abuf)) {
alen = sizeof(abuf)-1;
}
@ -230,7 +230,7 @@ do_search(
*ptr++ = ' ';
len++;
}
ptr = lutil_strncopy(ptr, op->oq_search.rs_attrs[i].an_name.bv_val, alen);
ptr = lutil_strncopy(ptr, op->ors_attrs[i].an_name.bv_val, alen);
len += alen;
*ptr = '\0';
}
@ -242,7 +242,7 @@ do_search(
manageDSAit = get_manageDSAit( op );
if ( op->oq_search.rs_scope == LDAP_SCOPE_BASE ) {
if ( op->ors_scope == LDAP_SCOPE_BASE ) {
Entry *entry = NULL;
if ( op->o_req_ndn.bv_len == 0 ) {
@ -259,7 +259,7 @@ do_search(
}
#ifdef LDAP_SLAPI
attrs = anlist2charray( op->oq_search.rs_attrs );
attrs = anlist2charray( op->ors_attrs );
initSearchPlugin( op, attrs, manageDSAit );
rs->sr_err = doPreSearchPluginFNs( op );
if ( rs->sr_err == LDAP_SUCCESS ) {
@ -278,7 +278,7 @@ do_search(
}
#ifdef LDAP_SLAPI
attrs = anlist2charray( op->oq_search.rs_attrs );
attrs = anlist2charray( op->ors_attrs );
initSearchPlugin( op, attrs, manageDSAit );
rs->sr_err = doPreSearchPluginFNs( op );
if ( rs->sr_err == LDAP_SUCCESS ) {
@ -298,11 +298,11 @@ do_search(
goto return_results;
} else if ( entry != NULL ) {
rs->sr_err = test_filter( op, entry, op->oq_search.rs_filter );
rs->sr_err = test_filter( op, entry, op->ors_filter );
if( rs->sr_err == LDAP_COMPARE_TRUE ) {
rs->sr_entry = entry;
rs->sr_attrs = op->oq_search.rs_attrs;
rs->sr_attrs = op->ors_attrs;
send_search_entry( op, rs );
rs->sr_entry = NULL;
}
@ -333,7 +333,7 @@ do_search(
*/
if ( (op->o_bd = select_backend( &op->o_req_ndn, manageDSAit, 1 )) == NULL ) {
rs->sr_ref = referral_rewrite( default_referral,
NULL, &op->o_req_dn, op->oq_search.rs_scope );
NULL, &op->o_req_dn, op->ors_scope );
if (!rs->sr_ref) rs->sr_ref = default_referral;
rs->sr_err = LDAP_REFERRAL;
@ -357,7 +357,7 @@ do_search(
}
#ifdef LDAP_SLAPI
attrs = anlist2charray( op->oq_search.rs_attrs );
attrs = anlist2charray( op->ors_attrs );
initSearchPlugin( op, attrs, manageDSAit );
rs->sr_err = doPreSearchPluginFNs( op );
if ( rs->sr_err != LDAP_SUCCESS ) {
@ -396,9 +396,9 @@ return_results:;
if( op->o_req_dn.bv_val != NULL) free( op->o_req_dn.bv_val );
if( op->o_req_ndn.bv_val != NULL) free( op->o_req_ndn.bv_val );
if( op->oq_search.rs_filterstr.bv_val != NULL) free( op->oq_search.rs_filterstr.bv_val );
if( op->oq_search.rs_filter != NULL) filter_free( op->oq_search.rs_filter );
if( op->oq_search.rs_attrs != NULL ) free( op->oq_search.rs_attrs );
if( op->ors_filterstr.bv_val != NULL) free( op->ors_filterstr.bv_val );
if( op->ors_filter != NULL) filter_free( op->ors_filter );
if( op->ors_attrs != NULL ) free( op->ors_attrs );
#ifdef LDAP_SLAPI
if( attrs != NULL) ch_free( attrs );
#endif /* LDAP_SLAPI */
@ -433,14 +433,14 @@ static void initSearchPlugin( Operation *op,
{
slapi_x_pblock_set_operation( op->o_pb, op );
slapi_pblock_set( op->o_pb, SLAPI_SEARCH_TARGET, (void *)op->o_req_dn.bv_val );
slapi_pblock_set( op->o_pb, SLAPI_SEARCH_SCOPE, (void *)op->oq_search.rs_scope );
slapi_pblock_set( op->o_pb, SLAPI_SEARCH_DEREF, (void *)op->oq_search.rs_deref );
slapi_pblock_set( op->o_pb, SLAPI_SEARCH_SIZELIMIT, (void *)op->oq_search.rs_slimit );
slapi_pblock_set( op->o_pb, SLAPI_SEARCH_TIMELIMIT, (void *)op->oq_search.rs_tlimit );
slapi_pblock_set( op->o_pb, SLAPI_SEARCH_FILTER, (void *)op->oq_search.rs_filter );
slapi_pblock_set( op->o_pb, SLAPI_SEARCH_STRFILTER, (void *)op->oq_search.rs_filterstr.bv_val );
slapi_pblock_set( op->o_pb, SLAPI_SEARCH_SCOPE, (void *)op->ors_scope );
slapi_pblock_set( op->o_pb, SLAPI_SEARCH_DEREF, (void *)op->ors_deref );
slapi_pblock_set( op->o_pb, SLAPI_SEARCH_SIZELIMIT, (void *)op->ors_slimit );
slapi_pblock_set( op->o_pb, SLAPI_SEARCH_TIMELIMIT, (void *)op->ors_tlimit );
slapi_pblock_set( op->o_pb, SLAPI_SEARCH_FILTER, (void *)op->ors_filter );
slapi_pblock_set( op->o_pb, SLAPI_SEARCH_STRFILTER, (void *)op->ors_filterstr.bv_val );
slapi_pblock_set( op->o_pb, SLAPI_SEARCH_ATTRS, (void *)attrs );
slapi_pblock_set( op->o_pb, SLAPI_SEARCH_ATTRSONLY, (void *)op->oq_search.rs_attrsonly );
slapi_pblock_set( op->o_pb, SLAPI_SEARCH_ATTRSONLY, (void *)op->ors_attrsonly );
slapi_pblock_set( op->o_pb, SLAPI_MANAGEDSAIT, (void *)managedsait );
}
@ -477,16 +477,16 @@ static int doSearchRewriteFNs( Operation *op )
* The plugin can set the SLAPI_SEARCH_FILTER.
* SLAPI_SEARCH_STRFILER is not normative.
*/
slapi_pblock_get( op->o_pb, SLAPI_SEARCH_FILTER, (void *)&op->oq_search.rs_filter);
ch_free( op->oq_search.rs_filterstr.bv_val );
filter2bv( op->oq_search.rs_filter, &op->oq_search.rs_filterstr );
slapi_pblock_get( op->o_pb, SLAPI_SEARCH_FILTER, (void *)&op->ors_filter);
ch_free( op->ors_filterstr.bv_val );
filter2bv( op->ors_filter, &op->ors_filterstr );
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, ARGS,
"doSearchRewriteFNs: after compute_rewrite_search filter: %s\n",
op->oq_search.rs_filterstr.bv_len ? op->oq_search.rs_filterstr.bv_val : "empty", 0, 0 );
op->ors_filterstr.bv_len ? op->ors_filterstr.bv_val : "empty", 0, 0 );
#else
Debug( LDAP_DEBUG_ARGS, " after compute_rewrite_search filter: %s\n",
op->oq_search.rs_filterstr.bv_len ? op->oq_search.rs_filterstr.bv_val : "empty", 0, 0 );
op->ors_filterstr.bv_len ? op->ors_filterstr.bv_val : "empty", 0, 0 );
#endif
}

View file

@ -26,7 +26,7 @@ starttls_extop ( Operation *op, SlapReply *rs )
void *ctx;
int rc;
if ( op->oq_extended.rs_reqdata != NULL ) {
if ( op->ore_reqdata != NULL ) {
/* no request data should be provided */
rs->sr_text = "no request data expected";
return LDAP_PROTOCOL_ERROR;