]> git.sur5r.net Git - openldap/commitdiff
fix root entry delete/add
authorPierangelo Masarati <ando@openldap.org>
Mon, 7 Nov 2005 01:08:41 +0000 (01:08 +0000)
committerPierangelo Masarati <ando@openldap.org>
Mon, 7 Nov 2005 01:08:41 +0000 (01:08 +0000)
servers/slapd/back-sql/add.c
servers/slapd/back-sql/delete.c

index e82eae5bed5e08c71e13abc0f06202f0a29acaf0..15c3b9742a3c5115f01c9b390f0c51e3dcf2735c 100644 (file)
@@ -1111,34 +1111,34 @@ backsql_add( Operation *op, SlapReply *rs )
 
        } else {
                dnParent( &op->ora_e->e_nname, &pdn );
-       }
 
-       /*
-        * Get the parent
-        */
-       bsi.bsi_e = &p;
-       rs->sr_err = backsql_init_search( &bsi, &pdn,
-                       LDAP_SCOPE_BASE, 
-                       (time_t)(-1), NULL, dbh, op, rs, slap_anlist_no_attrs,
-                       ( BACKSQL_ISF_MATCHED | BACKSQL_ISF_GET_ENTRY ) );
-       if ( rs->sr_err != LDAP_SUCCESS ) {
-               Debug( LDAP_DEBUG_TRACE, "backsql_add(): "
-                       "could not retrieve addDN parent "
-                       "\"%s\" ID - %s matched=\"%s\"\n", 
-                       pdn.bv_val,
-                       rs->sr_err == LDAP_REFERRAL ? "referral" : "no such entry",
-                       rs->sr_matched ? rs->sr_matched : "(null)" );
-               e = &p;
-               goto done;
-       }
+               /*
+                * Get the parent
+                */
+               bsi.bsi_e = &p;
+               rs->sr_err = backsql_init_search( &bsi, &pdn,
+                               LDAP_SCOPE_BASE, 
+                               (time_t)(-1), NULL, dbh, op, rs, slap_anlist_no_attrs,
+                               ( BACKSQL_ISF_MATCHED | BACKSQL_ISF_GET_ENTRY ) );
+               if ( rs->sr_err != LDAP_SUCCESS ) {
+                       Debug( LDAP_DEBUG_TRACE, "backsql_add(): "
+                               "could not retrieve addDN parent "
+                               "\"%s\" ID - %s matched=\"%s\"\n", 
+                               pdn.bv_val,
+                               rs->sr_err == LDAP_REFERRAL ? "referral" : "no such entry",
+                               rs->sr_matched ? rs->sr_matched : "(null)" );
+                       e = &p;
+                       goto done;
+               }
 
-       /* check "children" pseudo-attribute access to parent */
-       if ( !access_allowed( op, &p, slap_schema.si_ad_children,
-                               NULL, ACL_WADD, NULL ) )
-       {
-               rs->sr_err = LDAP_INSUFFICIENT_ACCESS;
-               e = &p;
-               goto done;
+               /* check "children" pseudo-attribute access to parent */
+               if ( !access_allowed( op, &p, slap_schema.si_ad_children,
+                                       NULL, ACL_WADD, NULL ) )
+               {
+                       rs->sr_err = LDAP_INSUFFICIENT_ACCESS;
+                       e = &p;
+                       goto done;
+               }
        }
 
        if ( get_assert( op ) &&
index 2d920a4656d7aaf4dbaaba7caa2cf8bfaa5eb38a..0ee1ec2ecd55f3e3a84240b21ae4807d7325290e 100644 (file)
@@ -217,10 +217,10 @@ backsql_delete( Operation *op, SlapReply *rs )
        /*
         * Get the parent
         */
+       e_id = bsi.bsi_base_id;
        if ( !be_issuffix( op->o_bd, &op->o_req_ndn ) ) {
                dnParent( &op->o_req_ndn, &pdn );
                bsi.bsi_e = &p;
-               e_id = bsi.bsi_base_id;
                rs->sr_err = backsql_init_search( &bsi, &pdn,
                                LDAP_SCOPE_BASE, 
                                (time_t)(-1), NULL, dbh, op, rs,