s4:acl LDB module - remove the "forest DN" check
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Sun, 1 Aug 2010 15:02:45 +0000 (17:02 +0200)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Sun, 1 Aug 2010 19:30:28 +0000 (21:30 +0200)
After some reading I've discovered that this isn't really true. The forest
partition does exist on one or more DCs and is there the same as the default
base DN (which is already checked by the module).
And if we have other DCs which contain child domains then they never contain
data of the forest domain beside the schema and the configuration partition
(which are checked anyway) since a DC can always contain only one domain!

Link: http://www.informit.com/articles/article.aspx?p=26896&seqNum=5
source4/dsdb/samdb/ldb_modules/acl.c

index 77503a664e270514b8b4909175d245e294dc6e82..1b85c5ded969d79d336dd5c03e0a1c60028f53f5 100644 (file)
@@ -623,8 +623,7 @@ static int acl_add(struct ldb_module *module, struct ldb_request *req)
        /* FIXME: this has to be made dynamic at some point */
        if ((ldb_dn_compare(req->op.add.message->dn, (ldb_get_schema_basedn(ldb))) == 0) ||
            (ldb_dn_compare(req->op.add.message->dn, (ldb_get_config_basedn(ldb))) == 0) ||
-           (ldb_dn_compare(req->op.add.message->dn, (ldb_get_default_basedn(ldb))) == 0) ||
-           (ldb_dn_compare(req->op.add.message->dn, (ldb_get_root_basedn(ldb))) == 0)) {
+           (ldb_dn_compare(req->op.add.message->dn, (ldb_get_default_basedn(ldb))) == 0)) {
                return ldb_next_request(module, req);
        }
 
@@ -1025,8 +1024,7 @@ static int acl_delete(struct ldb_module *module, struct ldb_request *req)
        /* FIXME: this has to be made dynamic at some point */
        if ((ldb_dn_compare(req->op.del.dn, (ldb_get_schema_basedn(ldb))) == 0) ||
            (ldb_dn_compare(req->op.del.dn, (ldb_get_config_basedn(ldb))) == 0) ||
-           (ldb_dn_compare(req->op.del.dn, (ldb_get_default_basedn(ldb))) == 0) ||
-           (ldb_dn_compare(req->op.del.dn, (ldb_get_root_basedn(ldb))) == 0)) {
+           (ldb_dn_compare(req->op.del.dn, (ldb_get_default_basedn(ldb))) == 0)) {
                DEBUG(10,("acl:deleting an NC\n"));
                return ldb_module_done(req, NULL, NULL, LDB_ERR_INSUFFICIENT_ACCESS_RIGHTS);
        }
@@ -1153,8 +1151,7 @@ static int acl_rename(struct ldb_module *module, struct ldb_request *req)
        /* FIXME: this has to be made dynamic at some point */
        if ((ldb_dn_compare(req->op.rename.newdn, (ldb_get_schema_basedn(ldb))) == 0) ||
            (ldb_dn_compare(req->op.rename.newdn, (ldb_get_config_basedn(ldb))) == 0) ||
-           (ldb_dn_compare(req->op.rename.newdn, (ldb_get_default_basedn(ldb))) == 0) ||
-           (ldb_dn_compare(req->op.rename.newdn, (ldb_get_root_basedn(ldb))) == 0)) {
+           (ldb_dn_compare(req->op.rename.newdn, (ldb_get_default_basedn(ldb))) == 0)) {
                DEBUG(10,("acl:moving as an NC\n"));
                return LDB_ERR_INSUFFICIENT_ACCESS_RIGHTS;
        }