dsdb-acl: Do not apply ACL on special DNs to hide attributes that the user shouldn...
authorMatthieu Patou <mat@matws.net>
Sun, 30 Dec 2012 10:27:25 +0000 (02:27 -0800)
committerMatthieu Patou <mat@matws.net>
Thu, 17 Jan 2013 08:20:45 +0000 (00:20 -0800)
This fix frequent reindexing when using python script with a
user that is not system.
The reindexing is caused by ACL module hidding (removing) attributes in
the search request for all attributes in dn=@ATTRIBUTES and because
dsdb_schema_set_indices_and_attributes checks that the list of
attributes that it just calculated from the schema is the same as the
list written in @ATTRIBUTES, if not the list is replaced and a
reindexing is triggered.

Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source4/dsdb/samdb/ldb_modules/acl.c

index e5597710e822db8b8c587c787435515036273ff4..250456876490b9253f4c967805500efb6baf66a8 100644 (file)
@@ -1644,6 +1644,10 @@ static int acl_search(struct ldb_module *module, struct ldb_request *req)
        int ret;
        unsigned int i;
 
+       if (ldb_dn_is_special(req->op.search.base)) {
+               return ldb_next_request(module, req);
+       }
+
        ldb = ldb_module_get_ctx(module);
 
        ac = talloc_zero(req, struct acl_context);