From: Garming Sam Date: Tue, 5 Sep 2017 04:03:04 +0000 (+1200) Subject: objectclass: Ensure that backlinks are not replicated X-Git-Tag: talloc-2.1.11~204 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d9c6f47851311838ba6a67f8effc7a4e398e12ca;p=thirdparty%2Fsamba.git objectclass: Ensure that backlinks are not replicated Adprep schema adds backlinks, but they do not have the NOT_REPLICATED bit. We need to force this in locally to ensure we have it. Signed-off-by: Garming Sam Reviewed-by: Andrew Bartlett --- diff --git a/source4/dsdb/samdb/ldb_modules/objectclass.c b/source4/dsdb/samdb/ldb_modules/objectclass.c index c9301496a26..36ab76e19fc 100644 --- a/source4/dsdb/samdb/ldb_modules/objectclass.c +++ b/source4/dsdb/samdb/ldb_modules/objectclass.c @@ -405,6 +405,7 @@ static int objectclass_do_add(struct oc_context *ac) } if (ac->schema != NULL) { + unsigned int linkID = 0; /* * Notice: by the normalization function call in "ldb_request()" * case "LDB_ADD" we have always only *one* "objectClass" @@ -606,6 +607,11 @@ static int objectclass_do_add(struct oc_context *ac) } /* TODO: If parent object is site or subnet, also add (SYSTEM_FLAG_CONFIG_ALLOW_RENAME) */ + linkID = ldb_msg_find_attr_as_int(msg, "linkID", 0); + if (linkID > 0 && linkID % 2 == 1) { + systemFlags |= DS_FLAG_ATTR_NOT_REPLICATED; + } + if (el || systemFlags != 0) { ret = samdb_msg_add_int(ldb, msg, msg, "systemFlags", systemFlags);