/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1998-2004 The OpenLDAP Foundation.
+ * Copyright 1998-2005 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
int isroot = -1;
int rc_id = 0;
ID id = NOID;
- const char *text = NULL;
char textbuf[SLAP_TEXT_BUFLEN];
size_t textlen = sizeof textbuf;
/* Added to support newSuperior */
: NULL;
cache_return_entry_r( &li->li_cache, matched );
} else {
- BerVarray deref = NULL;
- if ( !LDAP_STAILQ_EMPTY( &op->o_bd->be_syncinfo )) {
- syncinfo_t *si;
- LDAP_STAILQ_FOREACH( si, &op->o_bd->be_syncinfo, si_next ) {
- struct berval tmpbv;
- ber_dupbv( &tmpbv, &si->si_provideruri_bv[0] );
- ber_bvarray_add( &deref, &tmpbv );
- }
- } else {
- deref = default_referral;
- }
- rs->sr_ref = referral_rewrite( deref, NULL, &op->o_req_dn,
- LDAP_SCOPE_DEFAULT );
+ rs->sr_ref = referral_rewrite( default_referral, NULL,
+ &op->o_req_dn, LDAP_SCOPE_DEFAULT );
}
ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
}
/* check entry for "entry" acl */
- if ( ! access_allowed( op, e,
- entry, NULL, ACL_WRITE, NULL ) )
+ if ( ! access_allowed( op, e, entry, NULL, ACL_WRITE, NULL ) )
{
Debug( LDAP_DEBUG_TRACE,
"<=- ldbm_back_modrdn: no write access to entry\n", 0,
}
/* check parent for "children" acl */
- if ( ! access_allowed( op, p,
- children, NULL, ACL_WRITE, NULL ) )
+ if ( ! access_allowed( op, p, children, NULL,
+ op->oq_modrdn.rs_newSup != NULL ?
+ ACL_WDEL : ACL_WRITE,
+ NULL ) )
{
Debug( LDAP_DEBUG_TRACE, "no access to parent\n", 0,
0, 0 );
p = (Entry *)&slap_entry_root;
can_access = access_allowed( op, p,
- children, NULL, ACL_WRITE, NULL );
+ children, NULL,
+ op->oq_modrdn.rs_newSup ?
+ ACL_WDEL : ACL_WRITE,
+ NULL );
p = NULL;
/* check parent for "children" acl */
/* check newSuperior for "children" acl */
if ( !access_allowed( op, np, children, NULL,
- ACL_WRITE, NULL ) )
+ ACL_WADD, NULL ) )
{
Debug( LDAP_DEBUG_TRACE,
"ldbm_back_modrdn: no wr to newSup children\n",
np = (Entry *)&slap_entry_root;
can_access = access_allowed( op, np,
- children, NULL, ACL_WRITE, NULL );
+ children, NULL, ACL_WADD, NULL );
np = NULL;
/* check parent for "children" acl */
/* check for abandon */
if ( op->o_abandon ) {
+ rs->sr_err = SLAPD_ABANDON;
goto return_results;
}
/* check for abandon */
if ( op->o_abandon ) {
+ rs->sr_err = SLAPD_ABANDON;
goto return_results;
}
tmp = mod->sml_next;
free( mod );
}
- slap_mods_free( mod );
+ slap_mods_free( mod, 1 );
}
/* LDAP v3 Support */