From fff3f290736f0b75903bfefeb961ee935930303b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 4 Aug 2011 14:59:47 +1000 Subject: s4-ldb: two DNs only match if they have the same deletion status Autobuild-User: Andrew Tridgell Autobuild-Date: Thu Aug 4 09:34:08 CEST 2011 on sn-devel-104 --- lib/ldb-samba/ldif_handlers.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib/ldb-samba') diff --git a/lib/ldb-samba/ldif_handlers.c b/lib/ldb-samba/ldif_handlers.c index a89749750f..6ca419b139 100644 --- a/lib/ldb-samba/ldif_handlers.c +++ b/lib/ldb-samba/ldif_handlers.c @@ -1130,6 +1130,7 @@ static int samba_dn_extended_match(struct ldb_context *ldb, TALLOC_CTX *tmp_ctx; struct ldb_dn *dn1, *dn2; const struct ldb_val *guid1, *guid2, *sid1, *sid2; + uint32_t rmd_flags1, rmd_flags2; tmp_ctx = talloc_new(ldb); @@ -1142,6 +1143,18 @@ static int samba_dn_extended_match(struct ldb_context *ldb, return LDB_SUCCESS; } + rmd_flags1 = dsdb_dn_rmd_flags(dn1); + rmd_flags2 = dsdb_dn_rmd_flags(dn2); + + if ((rmd_flags1 & DSDB_RMD_FLAG_DELETED) != + (rmd_flags2 & DSDB_RMD_FLAG_DELETED)) { + /* only match if they have the same deletion status */ + talloc_free(tmp_ctx); + (*matched) = false; + return LDB_SUCCESS; + } + + guid1 = ldb_dn_get_extended_component(dn1, "GUID"); guid2 = ldb_dn_get_extended_component(dn2, "GUID"); if (guid1 && guid2) { -- cgit