s4:samdb: respect SEARCH_FLAG_PRESERVEONDELETE
authorArvid Requate <requate@univention.de>
Thu, 6 Feb 2014 16:50:57 +0000 (17:50 +0100)
committerKarolin Seeger <kseeger@samba.org>
Tue, 15 Jul 2014 10:46:14 +0000 (12:46 +0200)
According to MS-ADTS section 3.1.1.5.5.1.1 the searchFlags must be
checked.

Signed-off-by: Arvid Requate <requate@univention.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Thu Feb  6 21:42:22 CET 2014 on sn-devel-104

(cherry picked from commit 98c961eb82194cd0738dbc58e4ae9f81771b409e)

source4/dsdb/samdb/ldb_modules/repl_meta_data.c

index 55f3ce2b7c47a9b37a8a545483dae51f6ebb5e4e..9d1bac43456885de90828339a8aa957ae649d08f 100644 (file)
@@ -3214,8 +3214,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) {