mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-30 13:30:57 +08:00
let req_modify_s and req_modrdn_s have a common portion to interoperate within slap_mods_opattrs() (ITS#5093)
This commit is contained in:
parent
27428ac00e
commit
2f5bfba296
@ -522,7 +522,7 @@ retry: /* transaction retry */
|
||||
}
|
||||
/* Modify the entry */
|
||||
dummy = *e;
|
||||
rs->sr_err = bdb_modify_internal( op, lt2, op->oq_modify.rs_modlist,
|
||||
rs->sr_err = bdb_modify_internal( op, lt2, op->orm_modlist,
|
||||
&dummy, &rs->sr_text, textbuf, textlen );
|
||||
|
||||
if( rs->sr_err != LDAP_SUCCESS ) {
|
||||
|
@ -52,7 +52,7 @@ ldap_back_modify(
|
||||
return rs->sr_err;
|
||||
}
|
||||
|
||||
for ( i = 0, ml = op->oq_modify.rs_modlist; ml; i++, ml = ml->sml_next )
|
||||
for ( i = 0, ml = op->orm_modlist; ml; i++, ml = ml->sml_next )
|
||||
/* just count mods */ ;
|
||||
|
||||
modv = (LDAPMod **)ch_malloc( ( i + 1 )*sizeof( LDAPMod * )
|
||||
@ -64,7 +64,7 @@ ldap_back_modify(
|
||||
mods = (LDAPMod *)&modv[ i + 1 ];
|
||||
|
||||
isupdate = be_shadow_update( op );
|
||||
for ( i = 0, ml = op->oq_modify.rs_modlist; ml; ml = ml->sml_next ) {
|
||||
for ( i = 0, ml = op->orm_modlist; ml; ml = ml->sml_next ) {
|
||||
if ( !isupdate && !get_relax( op ) && ml->sml_desc->ad_type->sat_no_user_mod )
|
||||
{
|
||||
continue;
|
||||
|
@ -111,7 +111,7 @@ monitor_subsys_log_modify(
|
||||
int rc = LDAP_OTHER;
|
||||
int newlevel = ldap_syslog;
|
||||
Attribute *save_attrs;
|
||||
Modifications *modlist = op->oq_modify.rs_modlist;
|
||||
Modifications *modlist = op->orm_modlist;
|
||||
Modifications *ml;
|
||||
|
||||
ldap_pvt_thread_mutex_lock( &monitor_log_mutex );
|
||||
|
@ -62,7 +62,7 @@ monitor_back_modify( Operation *op, SlapReply *rs )
|
||||
return rs->sr_err;
|
||||
}
|
||||
|
||||
if ( !acl_check_modlist( op, e, op->oq_modify.rs_modlist )) {
|
||||
if ( !acl_check_modlist( op, e, op->orm_modlist )) {
|
||||
rc = LDAP_INSUFFICIENT_ACCESS;
|
||||
|
||||
} else {
|
||||
|
@ -46,7 +46,7 @@ shell_back_modify(
|
||||
Modification *mod;
|
||||
struct shellinfo *si = (struct shellinfo *) op->o_bd->be_private;
|
||||
AttributeDescription *entry = slap_schema.si_ad_entry;
|
||||
Modifications *ml = op->oq_modify.rs_modlist;
|
||||
Modifications *ml = op->orm_modlist;
|
||||
Entry e;
|
||||
FILE *rfp, *wfp;
|
||||
int i;
|
||||
|
@ -127,14 +127,14 @@ backsql_modify( Operation *op, SlapReply *rs )
|
||||
oc = backsql_id2oc( bi, bsi.bsi_base_id.eid_oc_id );
|
||||
assert( oc != NULL );
|
||||
|
||||
if ( !acl_check_modlist( op, &m, op->oq_modify.rs_modlist ) ) {
|
||||
if ( !acl_check_modlist( op, &m, op->orm_modlist ) ) {
|
||||
rs->sr_err = LDAP_INSUFFICIENT_ACCESS;
|
||||
e = &m;
|
||||
goto done;
|
||||
}
|
||||
|
||||
rs->sr_err = backsql_modify_internal( op, rs, dbh, oc,
|
||||
&bsi.bsi_base_id, op->oq_modify.rs_modlist );
|
||||
&bsi.bsi_base_id, op->orm_modlist );
|
||||
if ( rs->sr_err != LDAP_SUCCESS ) {
|
||||
e = &m;
|
||||
goto do_transact;
|
||||
|
@ -1002,9 +1002,9 @@ slap_parse_modlist(
|
||||
ber_tag_t tag;
|
||||
ber_len_t len;
|
||||
char *last;
|
||||
Modifications **modtail = &ms->rs_modlist;
|
||||
Modifications **modtail = &ms->rs_mods.rs_modlist;
|
||||
|
||||
ms->rs_modlist = NULL;
|
||||
ms->rs_mods.rs_modlist = NULL;
|
||||
ms->rs_increment = 0;
|
||||
|
||||
rs->sr_err = LDAP_SUCCESS;
|
||||
@ -1082,8 +1082,8 @@ slap_parse_modlist(
|
||||
|
||||
done:
|
||||
if ( rs->sr_err != LDAP_SUCCESS ) {
|
||||
slap_mods_free( ms->rs_modlist, 1 );
|
||||
ms->rs_modlist = NULL;
|
||||
slap_mods_free( ms->rs_mods.rs_modlist, 1 );
|
||||
ms->rs_mods.rs_modlist = NULL;
|
||||
ms->rs_increment = 0;
|
||||
}
|
||||
|
||||
|
@ -502,7 +502,7 @@ rwm_op_modify( Operation *op, SlapReply *rs )
|
||||
}
|
||||
|
||||
isupdate = be_shadow_update( op );
|
||||
for ( mlp = &op->oq_modify.rs_modlist; *mlp; ) {
|
||||
for ( mlp = &op->orm_modlist; *mlp; ) {
|
||||
int is_oc = 0;
|
||||
Modifications *ml;
|
||||
struct ldapmapping *mapping = NULL;
|
||||
|
@ -1908,23 +1908,27 @@ typedef struct req_compare_s {
|
||||
AttributeAssertion *rs_ava;
|
||||
} req_compare_s;
|
||||
|
||||
typedef struct req_modify_s {
|
||||
typedef struct req_modifications_s {
|
||||
Modifications *rs_modlist;
|
||||
int rs_increment; /* FIXME: temporary */
|
||||
char rs_no_opattrs; /* don't att modify operational attrs */
|
||||
} req_modifications_s;
|
||||
|
||||
typedef struct req_modify_s {
|
||||
req_modifications_s rs_mods; /* NOTE: must be first in req_modify_s & req_modrdn_s */
|
||||
int rs_increment;
|
||||
} req_modify_s;
|
||||
|
||||
typedef struct req_modrdn_s {
|
||||
Modifications *rs_modlist;
|
||||
req_modifications_s rs_mods; /* NOTE: must be first in req_modify_s & req_modrdn_s */
|
||||
int rs_deleteoldrdn;
|
||||
struct berval rs_newrdn;
|
||||
struct berval rs_nnewrdn;
|
||||
struct berval *rs_newSup;
|
||||
struct berval *rs_nnewSup;
|
||||
int rs_deleteoldrdn;
|
||||
} req_modrdn_s;
|
||||
|
||||
typedef struct req_add_s {
|
||||
Modifications *rs_modlist; /* FIXME: temporary */
|
||||
Modifications *rs_modlist;
|
||||
Entry *rs_e;
|
||||
} req_add_s;
|
||||
|
||||
@ -2450,20 +2454,24 @@ struct Operation {
|
||||
#define ors_filter oq_search.rs_filter
|
||||
#define ors_filterstr oq_search.rs_filterstr
|
||||
|
||||
#define orr_modlist oq_modrdn.rs_mods.rs_modlist
|
||||
#define orr_no_opattrs oq_modrdn.rs_mods.rs_no_opattrs
|
||||
#define orr_deleteoldrdn oq_modrdn.rs_deleteoldrdn
|
||||
#define orr_newrdn oq_modrdn.rs_newrdn
|
||||
#define orr_nnewrdn oq_modrdn.rs_nnewrdn
|
||||
#define orr_newSup oq_modrdn.rs_newSup
|
||||
#define orr_nnewSup oq_modrdn.rs_nnewSup
|
||||
#define orr_deleteoldrdn oq_modrdn.rs_deleteoldrdn
|
||||
#define orr_modlist oq_modrdn.rs_modlist
|
||||
|
||||
#define orc_ava oq_compare.rs_ava
|
||||
|
||||
#define ora_e oq_add.rs_e
|
||||
#define ora_modlist oq_add.rs_modlist
|
||||
|
||||
#define orn_msgid oq_abandon.rs_msgid
|
||||
#define orm_modlist oq_modify.rs_modlist
|
||||
|
||||
#define orm_modlist oq_modify.rs_mods.rs_modlist
|
||||
#define orm_no_opattrs oq_modify.rs_mods.rs_no_opattrs
|
||||
#define orm_increment oq_modify.rs_increment
|
||||
#define orm_no_opattrs oq_modify.rs_no_opattrs
|
||||
|
||||
#define ore_reqoid oq_extended.rs_reqoid
|
||||
#define ore_flags oq_extended.rs_flags
|
||||
|
Loading…
Reference in New Issue
Block a user