summaryrefslogtreecommitdiff
path: root/source4/dsdb
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2014-07-17 15:05:30 +0000
committerVolker Lendecke <vl@samba.org>2014-07-21 20:28:53 +0200
commit1dd64341d801d9adc66aa6432dc3afb64644e29b (patch)
treea169c4d5124b2465146d17d9a93500a853ddbb6b /source4/dsdb
parent53d1bbd20d252b7b759f6a5feb43a0f94b824437 (diff)
downloadsamba-1dd64341d801d9adc66aa6432dc3afb64644e29b.tar.gz
messaging4: Change irpc_servers_by_name to NTSTATUS
For me, counted arrays are easier to deal with than NULL-terminated ones. Here we also had a "server_id_is_disconnection" convention, which was not really obvious. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Mon Jul 21 20:28:53 CEST 2014 on sn-devel-104
Diffstat (limited to 'source4/dsdb')
-rw-r--r--source4/dsdb/samdb/ldb_modules/ridalloc.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/ridalloc.c b/source4/dsdb/samdb/ldb_modules/ridalloc.c
index f6738f9532a..05764eeb4fe 100644
--- a/source4/dsdb/samdb/ldb_modules/ridalloc.c
+++ b/source4/dsdb/samdb/ldb_modules/ridalloc.c
@@ -67,7 +67,8 @@
static int ridalloc_poke_rid_manager(struct ldb_module *module)
{
struct imessaging_context *msg;
- struct server_id *server;
+ unsigned num_servers;
+ struct server_id *servers;
struct ldb_context *ldb = ldb_module_get_ctx(module);
struct loadparm_context *lp_ctx =
(struct loadparm_context *)ldb_get_opaque(ldb, "loadparm");
@@ -85,8 +86,9 @@ static int ridalloc_poke_rid_manager(struct ldb_module *module)
return LDB_ERR_UNWILLING_TO_PERFORM;
}
- server = irpc_servers_byname(msg, msg, "dreplsrv");
- if (!server) {
+ status = irpc_servers_byname(msg, msg, "dreplsrv",
+ &num_servers, &servers);
+ if (!NT_STATUS_IS_OK(status)) {
ldb_asprintf_errstring(ldb_module_get_ctx(module),
"Failed to send MSG_DREPL_ALLOCATE_RID, "
"unable to locate dreplsrv");
@@ -95,13 +97,13 @@ static int ridalloc_poke_rid_manager(struct ldb_module *module)
return LDB_ERR_UNWILLING_TO_PERFORM;
}
- status = imessaging_send(msg, server[0], MSG_DREPL_ALLOCATE_RID, NULL);
+ status = imessaging_send(msg, servers[0], MSG_DREPL_ALLOCATE_RID, NULL);
/* Only error out if an error happened, not on STATUS_MORE_ENTRIES, ie a delayed message */
if (NT_STATUS_IS_ERR(status)) {
ldb_asprintf_errstring(ldb_module_get_ctx(module),
"Failed to send MSG_DREPL_ALLOCATE_RID to dreplsrv at %s: %s",
- server_id_str(tmp_ctx, server), nt_errstr(status));
+ server_id_str(tmp_ctx, servers), nt_errstr(status));
talloc_free(tmp_ctx);
return LDB_ERR_UNWILLING_TO_PERFORM;
}