Revert "TODO s4-kcc: Sets the isRecyled attributes on deleted entries when needed"
authorStefan Metzmacher <metze@samba.org>
Thu, 23 May 2013 06:36:24 +0000 (08:36 +0200)
committerStefan Metzmacher <metze@samba.org>
Mon, 4 Nov 2013 09:15:24 +0000 (10:15 +0100)
This reverts commit 5ed266d1b3eb6981ca0a4eef14a2139c3c5e63e5.

source4/dsdb/kcc/kcc_deleted.c

index f3965d8fc3f209d61134b939fa7e51dfd1e786e2..63bb97c08dcc4a5f20f8681a87a2bbc8d3bd4203 100644 (file)
@@ -45,8 +45,6 @@ NTSTATUS kccsrv_check_deleted(struct kccsrv_service *s, TALLOC_CTX *mem_ctx)
        int ret;
        uint32_t tombstoneLifetime;
        bool do_fs = false;
-       const struct dsdb_schema *schema;
-       const struct dsdb_attribute *isRecycled = NULL;
 
        time_t interval = lpcfg_parm_int(s->task->lp_ctx, NULL, "kccsrv",
                                                    "check_deleted_full_scan_interval", 86400);
@@ -57,7 +55,6 @@ NTSTATUS kccsrv_check_deleted(struct kccsrv_service *s, TALLOC_CTX *mem_ctx)
                return NT_STATUS_OK;
        }
        s->last_deleted_check = t;
-       DEBUG(11, ("Check deleted has kicked in !\n"));
 
        ret = dsdb_tombstone_lifetime(s->samdb, &tombstoneLifetime);
        if (ret != LDB_SUCCESS) {
@@ -81,17 +78,10 @@ NTSTATUS kccsrv_check_deleted(struct kccsrv_service *s, TALLOC_CTX *mem_ctx)
                s->last_full_scan_deleted_check = t - ((9 * interval) / 10);
        }
 
-       schema = dsdb_get_schema(s->samdb, mem_ctx);
-       if (!schema) {
-               return NT_STATUS_INTERNAL_DB_CORRUPTION;
-       }
-
-       isRecycled = dsdb_attribute_by_lDAPDisplayName(schema, "isRecycled");
-
        for (part=s->partitions; part; part=part->next) {
                struct ldb_dn *do_dn;
                struct ldb_result *res;
-               const char *attrs[] = { "whenChanged", "isRecycled", "msDS-LastKnownRDN", NULL };
+               const char *attrs[] = { "whenChanged", NULL };
                unsigned int i;
                TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
                if (!tmp_ctx) {
@@ -146,38 +136,6 @@ NTSTATUS kccsrv_check_deleted(struct kccsrv_service *s, TALLOC_CTX *mem_ctx)
                                        DEBUG(4,("Removed deleted object %s\n",
                                                 ldb_dn_get_linearized(res->msgs[i]->dn)));
                                }
-                       } else if (isRecycled &&
-                                  !ldb_msg_find_ldb_val(res->msgs[i], "isRecycled") &&
-                                  !ldb_msg_find_ldb_val(res->msgs[i], "msDS-LastKnownRDN")) {
-                               /*
-                                * There is no isRecycled attribute and no
-                                * msDS-LastKnownRDN attribute, then we
-                                * should add isRecycled: TRUE if the schema
-                                * supports it.
-                                */
-
-                               DEBUG(1,("Adding isRecycled to %s\n",
-                                       ldb_dn_get_linearized(res->msgs[i]->dn)));
-
-                               struct ldb_message *msg = ldb_msg_new(mem_ctx);
-                               if (msg == NULL) {
-                                       talloc_free(do_dn);
-                                       return NT_STATUS_NO_MEMORY;
-                               }
-
-                               msg->dn = res->msgs[i]->dn;
-                               ret = ldb_msg_add_string(msg, "isRecycled", "TRUE");
-                               if (ret != LDB_SUCCESS) {
-                                       talloc_free(do_dn);
-                                       return NT_STATUS_NO_MEMORY;
-                               }
-                               msg->elements[msg->num_elements - 1].flags = LDB_FLAG_MOD_ADD;
-
-                               ret = dsdb_modify(s->samdb, msg, DSDB_SEARCH_SHOW_DELETED);
-                               if (ret != LDB_SUCCESS) {
-                                       talloc_free(do_dn);
-                                       return NT_STATUS_INTERNAL_DB_CORRUPTION;
-                               }
                        }
                }