*/
if ( op->o_bd->be_add ) {
/* do the update here */
- int repl_user = be_isupdate(op->o_bd, &op->o_ndn );
+ int repl_user = be_isupdate( op );
#ifndef SLAPD_MULTIMASTER
if ( !SLAP_SHADOW(op->o_bd) || repl_user )
#else
/* no parent, must be root to delete */
if( ! be_isroot( op ) ) {
if ( be_issuffix( op->o_bd, (struct berval *)&slap_empty_bv )
- || be_isupdate( op->o_bd, &op->o_ndn ) ) {
+ || be_isupdate( op ) ) {
p = (Entry *)&slap_entry_root;
/* check parent for "children" acl */
isroot = be_isroot( op );
if ( ! isroot ) {
if ( be_issuffix( op->o_bd, (struct berval *)&slap_empty_bv )
- || be_isupdate( op->o_bd, &op->o_ndn ) ) {
+ || be_isupdate( op ) ) {
p = (Entry *)&slap_entry_root;
/* no parent, modrdn entry directly under root */
if ( ! isroot ) {
if ( be_issuffix( op->o_bd, (struct berval *)&slap_empty_bv )
- || be_isupdate( op->o_bd, &op->o_ndn ) ) {
+ || be_isupdate( op ) ) {
np = (Entry *)&slap_entry_root;
/* check parent for "children" acl */
dc.ctx = "addAttrDN";
#endif
- isupdate = be_isupdate( op->o_bd, &op->o_ndn );
+ isupdate = be_isupdate( op );
for (i=0, a=op->oq_add.rs_e->e_attrs; a; a=a->a_next) {
if ( !isupdate && a->a_desc->ad_type->sat_no_user_mod ) {
continue;
dc.ctx = "modifyAttrDN";
#endif
- isupdate = be_isupdate( op->o_bd, &op->o_ndn );
+ isupdate = be_isupdate( op );
for (i=0, ml=op->oq_modify.rs_modlist; ml; ml=ml->sml_next) {
int is_oc = 0;
} else {
/* no parent, must be root to delete */
if( ! be_isroot( op ) ) {
- if ( be_issuffix( op->o_bd, (struct berval *)&slap_empty_bv ) || be_isupdate( op->o_bd, &op->o_ndn ) ) {
+ if ( be_issuffix( op->o_bd, (struct berval *)&slap_empty_bv ) || be_isupdate( op ) ) {
p = (Entry *)&slap_entry_root;
rc = access_allowed( op, p,
/* no parent, must be root to modify rdn */
isroot = be_isroot( op );
if ( ! isroot ) {
- if ( be_issuffix( op->o_bd, (struct berval *)&slap_empty_bv ) || be_isupdate( op->o_bd, &op->o_ndn ) ) {
+ if ( be_issuffix( op->o_bd, (struct berval *)&slap_empty_bv ) || be_isupdate( op ) ) {
int can_access;
p = (Entry *)&slap_entry_root;
}
if ( ! isroot ) {
- if ( be_issuffix( op->o_bd, (struct berval *)&slap_empty_bv ) || be_isupdate( op->o_bd, &op->o_ndn ) ) {
+ if ( be_issuffix( op->o_bd, (struct berval *)&slap_empty_bv ) || be_isupdate( op ) ) {
int can_access;
np = (Entry *)&slap_entry_root;
}
int
-be_isupdate( Backend *be, struct berval *ndn )
+be_isupdate( Operation *op )
+{
+ return be_isupdate_dn( op->o_bd, &op->o_ndn );
+}
+
+int
+be_isupdate_dn( Backend *be, struct berval *ndn )
{
if ( !ndn->bv_len ) {
return( 0 );
*/
if ( op->o_bd->be_delete ) {
/* do the update here */
- int repl_user = be_isupdate( op->o_bd, &op->o_ndn );
+ int repl_user = be_isupdate( op );
#ifndef SLAPD_MULTIMASTER
if ( !SLAP_SHADOW(op->o_bd) || repl_user )
#else
*/
if ( op->o_bd->be_modify ) {
/* do the update here */
- int repl_user = be_isupdate( op->o_bd, &op->o_ndn );
+ int repl_user = be_isupdate( op );
/* Multimaster slapd does not have to check for replicator dn
* because it accepts each modify request
*/
if ( op->o_bd->be_modrdn ) {
/* do the update here */
- int repl_user = be_isupdate( op->o_bd, &op->o_ndn );
+ int repl_user = be_isupdate( op );
#ifndef SLAPD_MULTIMASTER
if ( !SLAP_SHADOW(op->o_bd) || repl_user )
#else
assert( new_rdn != NULL );
assert( !op->orr_deleteoldrdn || old_rdn != NULL );
- repl_user = be_isupdate( op->o_bd, &op->o_ndn );
+ repl_user = be_isupdate( op );
/* Add new attribute values to the entry */
for ( a_cnt = 0; new_rdn[a_cnt]; a_cnt++ ) {
static int
ppolicy_modify( Operation *op, SlapReply *rs )
{
- slap_overinst *on = (slap_overinst *)op->o_bd->bd_info;
- int i, rc, mod_pw_only, pwmod, pwmop, deladd, hsize = 0;
+ slap_overinst *on = (slap_overinst *)op->o_bd->bd_info;
+ int i, rc, mod_pw_only, pwmod, pwmop, deladd,
+ hsize = 0;
PassPolicy pp;
- Modifications *mods = NULL, *modtail, *ml, *delmod, *addmod;
+ Modifications *mods = NULL, *modtail, *ml, *delmod, *addmod;
Attribute *pa, *ha, *ra, at;
- int repl_user = be_isupdate( op->o_bd, &op->o_ndn );
+ int repl_user = be_isupdate( op );
const char *txt;
pw_hist *tl = NULL, *p;
- int zapReset, send_ctrl = 0;
+ int zapReset, send_ctrl = 0;
Entry *e;
- struct berval newpw = { 0, NULL }, oldpw = { 0, NULL }, *bv, cr[2];
+ struct berval newpw = { 0, NULL }, oldpw = { 0, NULL },
+ *bv, cr[2];
LDAPPasswordPolicyError pErr = PP_noError;
op->o_bd->bd_info = (BackendInfo *)on->on_info;
}
/* Count number of attributes in entry */
- isupdate = be_isupdate( op->o_bd, &op->o_ndn );
+ isupdate = be_isupdate( op );
for ( i = 0, ap = &op->oq_add.rs_e->e_attrs; *ap; ) {
struct berval mapped;
Attribute *a;
#ifndef SLAPD_MULTIMASTER
/* This does not apply to multi-master case */
- if(!( !SLAP_SHADOW( op->o_bd ) || be_isupdate( op->o_bd, &op->o_ndn ))) {
+ if(!( !SLAP_SHADOW( op->o_bd ) || be_isupdate( op ))) {
/* we SHOULD return a referral in this case */
BerVarray defref = op->o_bd->be_update_refs
? op->o_bd->be_update_refs : default_referral;
LDAP_SLAPD_F (int) be_isroot LDAP_P(( Operation *op ));
LDAP_SLAPD_F (int) be_isroot_dn LDAP_P(( Backend *be, struct berval *ndn ));
LDAP_SLAPD_F (int) be_isroot_pw LDAP_P(( Operation *op ));
-LDAP_SLAPD_F (int) be_isupdate LDAP_P(( Backend *be, struct berval *ndn ));
+LDAP_SLAPD_F (int) be_isupdate LDAP_P(( Operation *op ));
+LDAP_SLAPD_F (int) be_isupdate_dn LDAP_P(( Backend *be, struct berval *ndn ));
LDAP_SLAPD_F (struct berval *) be_root_dn LDAP_P(( Backend *be ));
LDAP_SLAPD_F (int) be_entry_get_rw LDAP_P(( struct slap_op *o,
struct berval *ndn, ObjectClass *oc,
if ( op->o_bd == NULL ) {
rc = LDAP_PARTIAL_RESULTS;
} else {
- int repl_user = be_isupdate( op->o_bd, &op->o_bd->be_rootdn );
+ int repl_user = be_isupdate_dn( op->o_bd, &op->o_bd->be_rootdn );
if ( !op->o_bd->be_update_ndn.bv_len || repl_user ) {
int update = op->o_bd->be_update_ndn.bv_len;
char textbuf[SLAP_TEXT_BUFLEN];
op->o_ndn = pConn->c_ndn = op->o_bd->be_rootndn;
if ( op->o_bd->be_delete ) {
- int repl_user = be_isupdate( op->o_bd, &op->o_ndn );
+ int repl_user = be_isupdate( op );
if ( !op->o_bd->be_update_ndn.bv_len || repl_user ) {
slap_callback cb = { NULL, slap_replog_cb, NULL, NULL };
if ( log_change ) op->o_callback = &cb;
op->oq_add.rs_e = *e;
if ( op->o_bd->be_add ) {
- int repl_user = be_isupdate( op->o_bd, &op->o_ndn );
+ int repl_user = be_isupdate( op );
if ( !op->o_bd->be_update_ndn.bv_len || repl_user ) {
slap_callback cb = { NULL, slap_replog_cb, NULL, NULL };
if ( log_changes ) op->o_callback = &cb;
op->oq_modrdn.rs_deleteoldrdn = deloldrdn;
if ( op->o_bd->be_modrdn ) {
- int repl_user = be_isupdate( op->o_bd, &op->o_ndn );
+ int repl_user = be_isupdate( op );
if ( !op->o_bd->be_update_ndn.bv_len || repl_user ) {
slap_callback cb = { NULL, slap_replog_cb, NULL, NULL };
if ( log_change ) op->o_callback = &cb;
op->oq_modify.rs_modlist = modlist;
if ( op->o_bd->be_modify ) {
- int repl_user = be_isupdate( op->o_bd, &op->o_ndn );
+ int repl_user = be_isupdate( op );
if ( !op->o_bd->be_update_ndn.bv_len || repl_user ) {
int update = op->o_bd->be_update_ndn.bv_len;
const char *text = NULL;
if ( op->o_bd != NULL ) {
isRoot = be_isroot( op );
- isUpdateDn = be_isupdate( op->o_bd, &op->o_ndn );
+ isUpdateDn = be_isupdate( op );
}
rc = slapi_int_pblock_set_backend( pb, op->o_bd );