summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamen Mazdrashki <kamenim@samba.org>2010-08-28 20:00:39 +0300
committerKamen Mazdrashki <kamenim@samba.org>2010-08-28 23:38:59 +0300
commitb954834ad1a60f006d0d391f17edbcaac9ed48f2 (patch)
treec5eacbdfe9193d70295d05e441063327b8866246
parent53551a76c5b6bdcbb2e039ee98f4a712fbc6e8cb (diff)
downloadsamba-b954834ad1a60f006d0d391f17edbcaac9ed48f2.tar.gz
samba-b954834ad1a60f006d0d391f17edbcaac9ed48f2.tar.bz2
samba-b954834ad1a60f006d0d391f17edbcaac9ed48f2.zip
s4-dreplsrv: Implement irpc stub to be used to force dreplsrv to update internal cache
This IRPC calls is to be used whenever repsFrom/repsTo are changed by administrative tool or KCC (i.e. Topology changes). At present, only KCC may change topology.
-rw-r--r--source4/dsdb/repl/drepl_service.c20
-rw-r--r--source4/librpc/idl/irpc.idl11
2 files changed, 31 insertions, 0 deletions
diff --git a/source4/dsdb/repl/drepl_service.c b/source4/dsdb/repl/drepl_service.c
index 652c16fda4..d118c45b6c 100644
--- a/source4/dsdb/repl/drepl_service.c
+++ b/source4/dsdb/repl/drepl_service.c
@@ -31,6 +31,7 @@
#include "librpc/gen_ndr/ndr_misc.h"
#include "librpc/gen_ndr/ndr_drsuapi.h"
#include "librpc/gen_ndr/ndr_drsblobs.h"
+#include "librpc/gen_ndr/ndr_irpc.h"
#include "param/param.h"
static WERROR dreplsrv_init_creds(struct dreplsrv_service *service)
@@ -127,6 +128,24 @@ static NTSTATUS drepl_replica_sync(struct irpc_message *msg,
return NT_STATUS_OK;
}
+/**
+ * Called when drplsrv should refresh its state.
+ * For example, when KCC change topology, dreplsrv
+ * should update its cache
+ *
+ * @param partition_dn If not empty/NULL, partition to update
+ */
+static NTSTATUS dreplsrv_refresh(struct irpc_message *msg,
+ struct dreplsrv_refresh *r)
+{
+ struct dreplsrv_service *s = talloc_get_type(msg->private_data,
+ struct dreplsrv_service);
+
+ r->out.werr = dreplsrv_refresh_partitions(s);
+
+ return NT_STATUS_OK;
+}
+
/*
startup the dsdb replicator service task
*/
@@ -214,6 +233,7 @@ static void dreplsrv_task_init(struct task_server *task)
irpc_add_name(task->msg_ctx, "dreplsrv");
+ IRPC_REGISTER(task->msg_ctx, irpc, DREPLSRV_REFRESH, dreplsrv_refresh, service);
IRPC_REGISTER(task->msg_ctx, drsuapi, DRSUAPI_DSREPLICASYNC, drepl_replica_sync, service);
messaging_register(task->msg_ctx, service, MSG_DREPL_ALLOCATE_RID, dreplsrv_allocate_rid);
}
diff --git a/source4/librpc/idl/irpc.idl b/source4/librpc/idl/irpc.idl
index 03a931661e..220cecfb89 100644
--- a/source4/librpc/idl/irpc.idl
+++ b/source4/librpc/idl/irpc.idl
@@ -148,4 +148,15 @@ import "misc.idl", "security.idl", "nbt.idl";
[in] astring reason
);
+ /******************************************************
+ management calls for the drepl server
+ ******************************************************/
+ /**
+ * Force dreplsrv to fefresh internal cache.
+ * @param partition_dn Partition to refresh cacheh for.
+ * If empy/NULL, refresh all partitions.
+ */
+ void dreplsrv_refresh(
+ [out] WERROR werr
+ );
}