#include "librpc/gen_ndr/ndr_drsblobs.h"
#include "librpc/gen_ndr/ndr_irpc.h"
#include "param/param.h"
+#include "libds/common/roles.h"
/**
* Call-back data for _drepl_replica_sync_done_cb()
{
service->system_session_info = system_session(service->task->lp_ctx);
if (service->system_session_info == NULL) {
- return WERR_NOMEM;
+ return WERR_NOT_ENOUGH_MEMORY;
}
return WERR_OK;
} else {
cb_data = talloc_zero(msg, struct drepl_replica_sync_cb_data);
if (!cb_data) {
- REPLICA_SYNC_FAIL("Not enought memory",
+ REPLICA_SYNC_FAIL("Not enough memory",
WERR_DS_DRA_INTERNAL_ERROR);
}
werr = dreplsrv_partition_source_dsa_by_guid(p,
&req1->source_dsa_guid,
&dsa);
+ if (W_ERROR_EQUAL(werr, WERR_DS_DRA_NO_REPLICA)) {
+ /* we don't have this source setup as
+ a replication partner. Create a
+ temporary dsa structure for this
+ replication */
+ werr = dreplsrv_partition_source_dsa_temporary(p,
+ msg,
+ &req1->source_dsa_guid,
+ &dsa);
+ }
}
if (!W_ERROR_IS_OK(werr)) {
REPLICA_SYNC_FAIL("Failed to locate source DSA for given NC",
* schedule replication event to force
* replication as soon as possible
*/
- dreplsrv_periodic_schedule(service, 0);
+ dreplsrv_pendingops_schedule(service, 0);
done:
return NT_STATUS_OK;
task_server_terminate(task, "dreplsrv: no DSDB replication required in domain member configuration",
false);
return;
- case ROLE_DOMAIN_CONTROLLER:
+ case ROLE_ACTIVE_DIRECTORY_DC:
/* Yes, we want DSDB replication */
break;
}