diff options
-rw-r--r-- | lib/ldb-samba/ldif_handlers.c | 13 |
1 files changed, 13 insertions, 0 deletions
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) { |