summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2016-06-15 15:43:55 +1200
committerAndrew Bartlett <abartlet@samba.org>2016-06-27 00:18:17 +0200
commitf5ca34e6e813a5b92ea084995ffc0ebb3c8b1368 (patch)
tree0bc2035f756ad08fb1e9b593fd715c6a54e5f181 /source4/dsdb/samdb/ldb_modules/repl_meta_data.c
parentea86f5eb0ceeb8ee18918ff956c060827608f5f6 (diff)
downloadsamba-f5ca34e6e813a5b92ea084995ffc0ebb3c8b1368.tar.gz
dsdb: Only fetch changed attributes in replmd_update_rpmd
This avoids fetching every attribute, including in particular links that may require additional work to resolve, when we will not look at them anyway Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules/repl_meta_data.c')
-rw-r--r--source4/dsdb/samdb/ldb_modules/repl_meta_data.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
index 0d378202ae1..cf49a3c1d4e 100644
--- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
+++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
@@ -1407,7 +1407,6 @@ static int replmd_update_rpmd(struct ldb_module *module,
const struct GUID *our_invocation_id;
int ret;
const char * const *attrs = NULL;
- const char * const attrs1[] = { "replPropertyMetaData", "*", NULL };
const char * const attrs2[] = { "uSNChanged", "objectClass", "instanceType", NULL };
struct ldb_result *res;
struct ldb_context *ldb;
@@ -1415,11 +1414,19 @@ static int replmd_update_rpmd(struct ldb_module *module,
enum urgent_situation situation;
bool rmd_is_provided;
bool rmd_is_just_resorted = false;
-
+ const char *not_rename_attrs[4 + msg->num_elements];
+
if (rename_attrs) {
attrs = rename_attrs;
} else {
- attrs = attrs1;
+ for (i = 0; i < msg->num_elements; i++) {
+ not_rename_attrs[i] = msg->elements[i].name;
+ }
+ not_rename_attrs[i] = "replPropertyMetaData";
+ not_rename_attrs[i+1] = "objectClass";
+ not_rename_attrs[i+2] = "instanceType";
+ not_rename_attrs[i+3] = NULL;
+ attrs = not_rename_attrs;
}
ldb = ldb_module_get_ctx(module);