]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-ldbm/delete.c
Import resetting of c_dn/c_cdn after anonymous bind.
[openldap] / servers / slapd / back-ldbm / delete.c
index fa8eac72ad327f37420554f76119d8ddd72d6377..79f405a7b5422e0075fef66bf9f85cc9fee732ec 100644 (file)
@@ -53,10 +53,10 @@ ldbm_back_delete(
                goto return_results;
        }
 
-#define SLAPD_CHILD_MODIFICATION_WITH_ENTRY_ACL 1
 #ifdef SLAPD_CHILD_MODIFICATION_WITH_ENTRY_ACL
-       if ( ! access_allowed( be, conn, op, e, "entry", NULL, op->o_dn,
-           ACL_WRITE ) ) {
+       if ( ! access_allowed( be, conn, op, e,
+               "entry", NULL, ACL_WRITE ) )
+       {
                Debug(LDAP_DEBUG_ARGS,
                        "<=- ldbm_back_delete: insufficient access %s\n",
                        dn, 0, 0);
@@ -81,8 +81,8 @@ ldbm_back_delete(
 
 #ifndef SLAPD_CHILD_MODIFICATION_WITH_ENTRY_ACL
                /* check parent for "children" acl */
-               if ( ! access_allowed( be, conn, op, p, "children", NULL,
-                       op->o_dn, ACL_WRITE ) )
+               if ( ! access_allowed( be, conn, op, p,
+                       "children", NULL, ACL_WRITE ) )
                {
                        Debug( LDAP_DEBUG_TRACE, "no access to parent\n", 0,
                                0, 0 );
@@ -94,7 +94,7 @@ ldbm_back_delete(
 
        } else {
                /* no parent, must be root to delete */
-               if( ! be_isroot( be, op->o_dn ) ) {
+               if( ! be_isroot( be, op->o_ndn ) ) {
                        Debug( LDAP_DEBUG_TRACE, "no parent & not root\n",
                                0, 0, 0);
                        send_ldap_result( conn, op, LDAP_INSUFFICIENT_ACCESS,
@@ -141,8 +141,9 @@ return_results:;
        if( p != NULL ) {
                /* free parent and writer lock */
                cache_return_entry_w( &li->li_cache, p );
+       }
 
-       } else if ( rootlock ) {
+       if ( rootlock ) {
                /* release root lock */
                pthread_mutex_unlock(&li->li_root_mutex);
        }