time_t current_time,
uint32_t tombstoneLifetime,
unsigned int *num_objects_removed,
- unsigned int *num_links_removed)
+ unsigned int *num_links_removed,
+ char **error_string)
{
int ret;
*num_objects_removed = 0;
*num_links_removed = 0;
-
+ *error_string = NULL;
num_link_attrs = 0;
/*
attrs, flags, filter);
if (ret != LDB_SUCCESS) {
- DEBUG(1,(__location__ ": Failed to search for deleted objects in %s\n",
- ldb_dn_get_linearized(do_dn)));
+ *error_string = talloc_asprintf(mem_ctx, "Failed to search for deleted objects in %s: %s",
+ ldb_dn_get_linearized(do_dn),
+ ldb_errstring(samdb));
TALLOC_FREE(tmp_ctx);
return NT_STATUS_INTERNAL_ERROR;
}
time_t current_time,
uint32_t tombstoneLifetime,
unsigned int *num_objects_removed,
- unsigned int *num_links_removed);
+ unsigned int *num_links_removed,
+ char **error_string);
unsigned int num_objects_removed = 0;
unsigned int num_links_removed = 0;
NTSTATUS status;
+ char *error_string = NULL;
if (current_time - s->last_deleted_check < interval) {
return NT_STATUS_OK;
s->partitions,
current_time, tombstoneLifetime,
&num_objects_removed,
- &num_links_removed);
+ &num_links_removed,
+ &error_string);
if (NT_STATUS_IS_OK(status)) {
DEBUG(5, ("garbage_collect_tombstones: Removed %u tombstone objects "
"objects and links after removing %u tombstone objects "
"and %u tombstone links successfully: %s\n",
num_objects_removed, num_links_removed,
- nt_errstr(status)));
+ error_string ? error_string : nt_errstr(status)));
}
return status;
}
NTSTATUS status;
unsigned int num_objects_removed = 0;
unsigned int num_links_removed = 0;
+ char *error_string = NULL;
if (!PyArg_ParseTuple(args, "OOL|L", &py_ldb,
&py_list_dn, &_current_time, &_tombstone_lifetime)) {
part, current_time,
tombstone_lifetime,
&num_objects_removed,
- &num_links_removed);
+ &num_links_removed,
+ &error_string);
if (!NT_STATUS_IS_OK(status)) {
- PyErr_SetNTSTATUS(status);
+ if (error_string) {
+ PyErr_Format(PyExc_RuntimeError, "%s", error_string);
+ } else {
+ PyErr_SetNTSTATUS(status);
+ }
+ TALLOC_FREE(mem_ctx);
return NULL;
}