s4:samdb: respect SEARCH_FLAG_PRESERVEONDELETE
authorArvid Requate <requate@univention.de>
Thu, 6 Feb 2014 16:50:57 +0000 (17:50 +0100)
committerDavid Disseldorp <ddiss@samba.org>
Thu, 6 Feb 2014 20:42:22 +0000 (21:42 +0100)
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

source4/dsdb/samdb/ldb_modules/repl_meta_data.c

index 91a5d9233c5a359f1569a8b4a05c29780b033bc3..c5dcf2140f1045aa87539b6d906a674998edccec 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) {