From: Andrew Bartlett Date: Tue, 14 Jun 2016 21:59:57 +0000 (+1200) Subject: dsdb: Provide shortcuut for repl_meta_data avoiding search of link targets X-Git-Tag: tdb-1.3.10~704 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2aeae27cb4fc1d78e899e93716fddcc717ad044d;p=thirdparty%2Fsamba.git dsdb: Provide shortcuut for repl_meta_data avoiding search of link targets This makes processing of large numbers of linked attributes much faster, as we never care about the names during that processing Signed-off-by: Andrew Bartlett Reviewed-by: Garming Sam --- diff --git a/source4/dsdb/samdb/ldb_modules/extended_dn_out.c b/source4/dsdb/samdb/ldb_modules/extended_dn_out.c index bdb35be4690..31835a73d29 100644 --- a/source4/dsdb/samdb/ldb_modules/extended_dn_out.c +++ b/source4/dsdb/samdb/ldb_modules/extended_dn_out.c @@ -472,6 +472,20 @@ static int extended_callback(struct ldb_request *req, struct ldb_reply *ares, } } + if (!checked_reveal_control) { + have_reveal_control = + ldb_request_get_control(req, LDB_CONTROL_REVEAL_INTERNALS) != NULL; + checked_reveal_control = true; + } + + /* + * Shortcut for repl_meta_data. We asked for the data + * 'as-is', so stop processing here! + */ + if (have_reveal_control && p->normalise == false && ac->inject == true) { + return ldb_module_send_entry(ac->req, msg, ares->controls); + } + /* Walk the returned elements (but only if we have a schema to * interpret the list with) */ for (i = 0; ac->schema && i < msg->num_elements; i++) { @@ -518,12 +532,6 @@ static int extended_callback(struct ldb_request *req, struct ldb_reply *ares, struct ldb_val *plain_dn = &msg->elements[i].values[j]; bool is_deleted_objects = false; - if (!checked_reveal_control) { - have_reveal_control = - ldb_request_get_control(req, LDB_CONTROL_REVEAL_INTERNALS) != NULL; - checked_reveal_control = true; - } - /* this is a fast method for detecting deleted linked attributes, working on the unparsed ldb_val */