/* note that state may be NULL during initialisation */
if (state != NULL && state->need_refresh) {
+ /* Do not move this assignment, it can cause recursion loops! */
state->need_refresh = false;
ret = dsdb_recyclebin_enabled(module, &state->recycle_bin_enabled);
if (ret != LDB_SUCCESS) {
- return ret;
+ state->recycle_bin_enabled = false;
+ /*
+ * We can fail to find the feature object
+ * during provision. Ignore any such error and
+ * assume the recycle bin cannot be enabled at
+ * this point in time.
+ */
+ if (ret != LDB_ERR_NO_SUCH_OBJECT) {
+ state->need_refresh = true;
+ return LDB_ERR_UNWILLING_TO_PERFORM;
+ }
}
}
"Could not find the feature object - dn: %s\n",
ldb_dn_get_linearized(feature_dn));
talloc_free(tmp_ctx);
- return LDB_ERR_OPERATIONS_ERROR;
+ return LDB_ERR_NO_SUCH_OBJECT;
}
if (res->msgs[0]->num_elements > 0) {
const char *attrs2[] = {"msDS-OptionalFeatureGUID", NULL};
ret = dsdb_check_optional_feature(module, recyclebin_guid, enabled);
if (ret != LDB_SUCCESS) {
ldb_asprintf_errstring(ldb, "Could not verify if Recycle Bin is enabled \n");
- return LDB_ERR_UNWILLING_TO_PERFORM;
+ return ret;
}
return LDB_SUCCESS;