diff --git a/source4/dsdb/kcc/garbage_collect_tombstones.c b/source4/dsdb/kcc/garbage_collect_tombstones.c index 80b30ebae2a..99d949e1a2a 100644 --- a/source4/dsdb/kcc/garbage_collect_tombstones.c +++ b/source4/dsdb/kcc/garbage_collect_tombstones.c @@ -36,16 +36,10 @@ NTSTATUS dsdb_garbage_collect_tombstones(TALLOC_CTX *mem_ctx, struct loadparm_co struct ldb_context *samdb, struct dsdb_ldb_dn_list_node *part, time_t current_time, - bool do_fs) + bool do_fs, + uint32_t tombstoneLifetime) { int ret; - uint32_t tombstoneLifetime; - - ret = dsdb_tombstone_lifetime(samdb, &tombstoneLifetime); - if (ret != LDB_SUCCESS) { - DEBUG(1,(__location__ ": Failed to get tombstone lifetime\n")); - return NT_STATUS_INTERNAL_DB_CORRUPTION; - } for (; part != NULL; part = part->next) { struct ldb_dn *do_dn; diff --git a/source4/dsdb/kcc/garbage_collect_tombstones.h b/source4/dsdb/kcc/garbage_collect_tombstones.h index 445c7b3ba5d..f5eceebb022 100644 --- a/source4/dsdb/kcc/garbage_collect_tombstones.h +++ b/source4/dsdb/kcc/garbage_collect_tombstones.h @@ -28,4 +28,5 @@ NTSTATUS dsdb_garbage_collect_tombstones(TALLOC_CTX *mem_ctx, struct loadparm_co struct ldb_context *samdb, struct dsdb_ldb_dn_list_node *part, time_t current_time, - bool do_fs); + bool do_fs, + uint32_t tombstoneLifetime); diff --git a/source4/dsdb/kcc/kcc_periodic.c b/source4/dsdb/kcc/kcc_periodic.c index 5b5d36ed0ae..eefc83f7477 100644 --- a/source4/dsdb/kcc/kcc_periodic.c +++ b/source4/dsdb/kcc/kcc_periodic.c @@ -601,7 +601,9 @@ WERROR kccsrv_periodic_schedule(struct kccsrv_service *service, uint32_t next_in */ static NTSTATUS kccsrv_check_deleted(struct kccsrv_service *s, TALLOC_CTX *mem_ctx) { + int ret; bool do_fs = false; + uint32_t tombstoneLifetime; time_t current = time(NULL); time_t interval = lpcfg_parm_int(s->task->lp_ctx, NULL, "kccsrv", "check_deleted_full_scan_interval", 86400); @@ -629,8 +631,15 @@ static NTSTATUS kccsrv_check_deleted(struct kccsrv_service *s, TALLOC_CTX *mem_c s->last_full_scan_deleted_check = current - ((9 * interval) / 10); } + ret = dsdb_tombstone_lifetime(s->samdb, &tombstoneLifetime); + if (ret != LDB_SUCCESS) { + DEBUG(1,(__location__ ": Failed to get tombstone lifetime\n")); + return NT_STATUS_INTERNAL_DB_CORRUPTION; + } + return dsdb_garbage_collect_tombstones(mem_ctx, s->task->lp_ctx, s->samdb, - s->partitions, current, do_fs); + s->partitions, current, do_fs, + tombstoneLifetime); } static void kccsrv_periodic_run(struct kccsrv_service *service)