s4-fsmo: update FSMO changes for recent IRPC work
authorAndrew Tridgell <tridge@samba.org>
Thu, 9 Sep 2010 06:16:05 +0000 (16:16 +1000)
committerKamen Mazdrashki <kamenim@samba.org>
Fri, 10 Sep 2010 10:08:20 +0000 (13:08 +0300)
the IRPC API has changed

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

source4/dsdb/repl/drepl_ridalloc.c
source4/dsdb/samdb/ldb_modules/rootdse.c

index d5db29b0025afda716e45e45136e2abfc76f5ca6..5cac09bc80868d88dbcf38b4b10f87dbf04604cd 100644 (file)
@@ -32,7 +32,7 @@
 
 
 /*
-  create the RID manager source dsa structure
+  create the role owner source dsa structure
  */
 
 WERROR drepl_create_role_owner_source_dsa(struct dreplsrv_service *service,
@@ -122,7 +122,7 @@ WERROR drepl_request_extended_op(struct dreplsrv_service *service,
 
        werr = dreplsrv_schedule_partition_pull_source(service, service->ncchanges_extended.role_owner_source_dsa,
                                                       extended_op, alloc_pool,
-                                                      callback);
+                                                      callback, NULL);
        return werr;
 }
 
@@ -161,7 +161,7 @@ static WERROR drepl_request_new_rid_pool(struct dreplsrv_service *service,
                                                fsmo_role_dn,
                                                DRSUAPI_EXOP_FSMO_RID_ALLOC,
                                                alloc_pool,
-                                               drepl_new_rid_pool_callback, NULL);
+                                               drepl_new_rid_pool_callback);
        return werr;
 }
 
index f77fcbed23d9f14db14f55e48dbf393c948c9038..3397d60119c1de323aa66710dd33cab441c1b8a2 100644 (file)
@@ -32,7 +32,7 @@
 #include "auth/auth.h"
 #include "param/param.h"
 #include "lib/messaging/irpc.h"
-#include "librpc/gen_ndr/ndr_irpc.h"
+#include "librpc/gen_ndr/ndr_irpc_c.h"
 
 struct private_data {
        unsigned int num_controls;
@@ -979,19 +979,25 @@ static int rootdse_become_master(struct ldb_module *module,
                                 uint32_t role)
 {
        struct drepl_takeFSMORole r;
-       struct server_id *sid;
        struct messaging_context *msg;
        struct ldb_context *ldb = ldb_module_get_ctx(module);
        TALLOC_CTX *tmp_ctx = talloc_new(req);
        struct loadparm_context *lp_ctx = ldb_get_opaque(ldb, "loadparm");
        NTSTATUS status_call, status_fn;
+       struct dcerpc_binding_handle *irpc_handle;
 
        msg = messaging_client_init(tmp_ctx, lpcfg_messaging_path(tmp_ctx, lp_ctx),
                                    ldb_get_event_context(ldb));
 
-       sid = irpc_servers_byname(msg, tmp_ctx, "dreplsrv");
+       irpc_handle = irpc_binding_handle_by_name(tmp_ctx, msg,
+                                                 "dreplsrv",
+                                                 &ndr_table_irpc);
+       if (irpc_handle == NULL) {
+               return ldb_oom(ldb);
+       }
        r.in.role = role;
-       status_call = IRPC_CALL(msg, sid[0], irpc, DREPL_TAKEFSMOROLE, &r, NULL);
+
+       status_call = dcerpc_drepl_takeFSMORole_r(irpc_handle, tmp_ctx, &r);
        if (!NT_STATUS_IS_OK(status_call)) {
                return LDB_ERR_OPERATIONS_ERROR;
        }