From: Douglas Bagnall Date: Thu, 2 Feb 2017 03:37:58 +0000 (+1300) Subject: replmd: treat a zero GUID as not present in get_parsed_dns X-Git-Tag: talloc-2.1.9~233 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=33a5b6a934ea5098cd84d3caaddc7658738c9d5e;p=thirdparty%2Fsamba.git replmd: treat a zero GUID as not present in get_parsed_dns This roughly follows the pattern in the 2009 commit 0d5d7f58473c989bff4 by the Andrews Tridgell and Bartlett, which dealt with zero GUIDs in replmd_add_fix_la(). That function is about to use get_parsed_dns() [see next commit], and the other users of get_parsed_dns don't really want to see zero guids, so it is simpler to test here. This makes hitting the GUID_all_zero branch of parsed_dn_find() even more unlikely. Signed-off-by: Douglas Bagnall Pair-programmed-with: Andrew Bartlett Reviewed-by: Andrew Bartlett --- diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c index dbdcb102928..41c8eb2304b 100644 --- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c +++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c @@ -2012,7 +2012,8 @@ static int get_parsed_dns(struct ldb_module *module, TALLOC_CTX *mem_ctx, dn = p->dsdb_dn->dn; status = dsdb_get_extended_dn_guid(dn, &p->guid, "GUID"); - if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_NOT_FOUND)) { + if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_NOT_FOUND) || + unlikely(GUID_all_zero(&p->guid))) { /* we got a DN without a GUID - go find the GUID */ int ret = dsdb_module_guid_by_dn(module, dn, &p->guid, parent); if (ret != LDB_SUCCESS) {