From: Pierangelo Masarati Date: Thu, 16 Aug 2007 09:48:53 +0000 (+0000) Subject: let req_modify_s and req_modrdn_s have a common portion to interoperate within slap_m... X-Git-Tag: OPENLDAP_REL_ENG_2_4_MP~208 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=2f5bfba29610be75ebc68edd334d7632e4aaecb8;p=openldap let req_modify_s and req_modrdn_s have a common portion to interoperate within slap_mods_opattrs() (ITS#5093) --- diff --git a/servers/slapd/back-bdb/modify.c b/servers/slapd/back-bdb/modify.c index 67f3b723ce..1ca4692a4c 100644 --- a/servers/slapd/back-bdb/modify.c +++ b/servers/slapd/back-bdb/modify.c @@ -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 ) { diff --git a/servers/slapd/back-ldap/modify.c b/servers/slapd/back-ldap/modify.c index 3c287cd8db..fc247cb571 100644 --- a/servers/slapd/back-ldap/modify.c +++ b/servers/slapd/back-ldap/modify.c @@ -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; diff --git a/servers/slapd/back-monitor/log.c b/servers/slapd/back-monitor/log.c index c25261b07c..8f6d07d29f 100644 --- a/servers/slapd/back-monitor/log.c +++ b/servers/slapd/back-monitor/log.c @@ -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 ); diff --git a/servers/slapd/back-monitor/modify.c b/servers/slapd/back-monitor/modify.c index a8d6c887db..5001bfabcf 100644 --- a/servers/slapd/back-monitor/modify.c +++ b/servers/slapd/back-monitor/modify.c @@ -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 { diff --git a/servers/slapd/back-shell/modify.c b/servers/slapd/back-shell/modify.c index 277c3c1dcd..d87a9bcccf 100644 --- a/servers/slapd/back-shell/modify.c +++ b/servers/slapd/back-shell/modify.c @@ -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; diff --git a/servers/slapd/back-sql/modify.c b/servers/slapd/back-sql/modify.c index 4ee11dbd58..cbd261dc46 100644 --- a/servers/slapd/back-sql/modify.c +++ b/servers/slapd/back-sql/modify.c @@ -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; diff --git a/servers/slapd/modify.c b/servers/slapd/modify.c index 140973ae3b..37fceebe43 100644 --- a/servers/slapd/modify.c +++ b/servers/slapd/modify.c @@ -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; } diff --git a/servers/slapd/overlays/rwm.c b/servers/slapd/overlays/rwm.c index 61523b398c..031f9f5d3c 100644 --- a/servers/slapd/overlays/rwm.c +++ b/servers/slapd/overlays/rwm.c @@ -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; diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index abfde097d4..d1e7b99fdd 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -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