[PATCH] s4:samdb: respect SEARCH_FLAG_PRESERVEONDELETE

Arvid Requate requate at univention.de
Thu Feb 6 09:50:57 MST 2014


According to MS-ADTS section 3.1.1.5.5.1.1 the searchFlags must be
checked.

Signed-off-by: Arvid Requate <requate at univention.de>
---
 source4/dsdb/samdb/ldb_modules/repl_meta_data.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
index ddbff8b..4518c32 100644
--- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
+++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
@@ -3226,8 +3226,13 @@ static int replmd_delete_internals(struct ldb_module *module, struct ldb_request
 				*/
 				continue;
 			}
-			if (!sa->linkID && ldb_attr_in_list(preserved_attrs, el->name)) {
-				continue;
+			if (!sa->linkID) {
+				if (ldb_attr_in_list(preserved_attrs, el->name)) {
+					continue;
+				}
+				if (sa->searchFlags & SEARCH_FLAG_PRESERVEONDELETE) {
+					continue;
+				}
 			}
 			ret = ldb_msg_add_empty(msg, el->name, LDB_FLAG_MOD_DELETE, &el);
 			if (ret != LDB_SUCCESS) {
-- 
1.8.5.3



More information about the samba-technical mailing list