0, 0 );
#endif
-
/* get entry with writer lock */
if ( (e = dn2entry_w( be, ndn, &matched )) == NULL ) {
char* matched_dn = NULL;
0, 0 );
#endif
-
send_ldap_result( conn, op, LDAP_REFERRAL,
e->e_dn, NULL, refs, NULL );
ber_bvecfree( refs );
-
goto return_results;
}
if ( (p_ndn = dn_parent( be, e->e_ndn )) != NULL ) {
-
/* Make sure parent entry exist and we can write its
* children.
*/
send_ldap_result( conn, op, LDAP_OTHER,
NULL, NULL, NULL, NULL );
+
goto return_results;
}
p_ndn, 0, 0 );
#endif
-
p_dn = dn_parent( be, e->e_dn );
-
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
p_dn, 0, 0 );
#endif
-
} else {
/* no parent, modrdn entry directly under root */
if( ! be_isroot( be, op->o_ndn ) ) {
"ldbm_back_modrdn: no parent, locked root\n",
0, 0, 0 );
#endif
-
-
}
new_parent_dn = p_dn; /* New Parent unless newSuperior given */
newSuperior, 0, 0 );
#endif
-
np_dn = ch_strdup( newSuperior );
np_ndn = ch_strdup( np_dn );
(void) dn_normalize( np_ndn );
}
if ( newSuperior != NULL ) {
-
/* newSuperior == entry being moved?, if so ==> ERROR */
/* Get Entry with dn=newSuperior. Does newSuperior exist? */
np, np->e_id, 0 );
#endif
-
/* check newSuperior for "children" acl */
if ( !access_allowed( be, conn, op, np, children, NULL,
ACL_WRITE ) )
0, 0 );
#endif
-
send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR,
NULL, NULL, NULL, NULL );
0, 0 , 0 );
#endif
-
new_parent_dn = np_dn;
}
/* Build target dn and make sure target entry doesn't exist already. */
-
build_new_dn( &new_dn, e->e_dn, new_parent_dn, newrdn );
-
new_ndn = ch_strdup(new_dn);
(void) dn_normalize( new_ndn );
new_ndn, 0, 0 );
#endif
-
/* check for abandon */
ldap_pvt_thread_mutex_lock( &op->o_abandonmutex );
if ( op->o_abandon ) {
new_ndn, 0, 0 );
#endif
-
/* Get attribute type and attribute value of our new rdn, we will
* need to add that to our new entry
*/
-
if ( (new_rdn_type = rdn_attr_type( newrdn )) == NULL ) {
-
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
"ldbm_back_modrdn: can't figure out type of newrdn\n" ));
send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR,
NULL, "unknown type used in RDN", NULL, NULL );
goto return_results;
-
}
if ( (new_rdn_val = rdn_attr_value( newrdn )) == NULL ) {
-
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
"ldbm_back_modrdn: can't figure out val of newrdn\n"));
send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR,
NULL, "could not parse RDN value", NULL, NULL );
goto return_results;
-
}
#ifdef NEW_LOGGING
new_rdn_val, new_rdn_type, 0 );
#endif
-
/* Retrieve the old rdn from the entry's dn */
-
if ( (old_rdn = dn_rdn( be, dn )) == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
"ldbm_back_modrdn: old_rdn_type=%s, new_rdn_type=%s!\n",
old_rdn_type, new_rdn_type, 0 );
#endif
-
}
#ifdef NEW_LOGGING
Debug( LDAP_DEBUG_TRACE, "ldbm_back_modrdn: DN_X500\n",
0, 0, 0 );
#endif
-
/* Add new attribute value to the entry.
*/
goto return_results;
}
}
+
mod[0].sml_bvalues = add_bvals;
mod[0].sml_op = SLAP_MOD_SOFTADD;
mod[0].sml_next = NULL;
/* Remove old rdn value if required */
-
if (deleteoldrdn) {
/* Get value of old rdn */
- if ((old_rdn_val = rdn_attr_value( old_rdn ))
- == NULL) {
-
+ if ((old_rdn_val = rdn_attr_value( old_rdn )) == NULL) {
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
"ldbm_back_modrdn: can't figure out old_rdn_val from old_rdn\n" ));
goto return_results;
}
}
+
mod[0].sml_next = &mod[1];
mod[1].sml_bvalues = del_bvals;
mod[1].sml_op = LDAP_MOD_DELETE;
"ldbm_back_modrdn: removing old_rdn_val=%s\n",
old_rdn_val, 0, 0 );
#endif
-
}
/* check for abandon */
if( old_rdn_type != NULL ) free(old_rdn_type);
if( old_rdn_val != NULL ) free(old_rdn_val);
-
/* LDAP v3 Support */
if ( np_dn != NULL ) free( np_dn );
if ( np_ndn != NULL ) free( np_ndn );