summaryrefslogtreecommitdiffstats
path: root/src/providers
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2011-05-02 10:04:44 -0400
committerStephen Gallagher <sgallagh@redhat.com>2011-05-06 10:24:36 -0400
commit28a410f423bf9bcdf43ed14cd4c50634753b51f3 (patch)
treede0eaa4cb0dccc5147d070ad8b76d8226c27a38b /src/providers
parent222072fd4383f742e0a1b1722946d4586fe37de7 (diff)
downloadsssd-28a410f423bf9bcdf43ed14cd4c50634753b51f3.tar.gz
sssd-28a410f423bf9bcdf43ed14cd4c50634753b51f3.tar.xz
sssd-28a410f423bf9bcdf43ed14cd4c50634753b51f3.zip
Create common sss_monitor_init()
This was implemented almost identically for both the responders and the providers. It is easier to maintain as a single routine. This patch also adds the ability to provide a private context to attach to the sbus_connection for later use.
Diffstat (limited to 'src/providers')
-rw-r--r--src/providers/data_provider_be.c38
1 files changed, 3 insertions, 35 deletions
diff --git a/src/providers/data_provider_be.c b/src/providers/data_provider_be.c
index 01d285580..0fbf809e5 100644
--- a/src/providers/data_provider_be.c
+++ b/src/providers/data_provider_be.c
@@ -868,40 +868,6 @@ static int be_srv_init(struct be_ctx *ctx)
return EOK;
}
-/* mon_cli_init
- * sbus channel to the monitor daemon */
-static int mon_cli_init(struct be_ctx *ctx)
-{
- char *sbus_address;
- int ret;
-
- /* Set up SBUS connection to the monitor */
- ret = monitor_get_sbus_address(ctx, &sbus_address);
- if (ret != EOK) {
- DEBUG(0, ("Could not locate monitor address.\n"));
- return ret;
- }
-
- ret = sbus_client_init(ctx, ctx->ev, sbus_address,
- &monitor_be_interface, &ctx->mon_conn,
- NULL, ctx);
- if (ret != EOK) {
- DEBUG(0, ("Failed to connect to monitor services.\n"));
- return ret;
- }
-
- /* Identify ourselves to the monitor */
- ret = monitor_common_send_id(ctx->mon_conn,
- ctx->identity,
- DATA_PROVIDER_VERSION);
- if (ret != EOK) {
- DEBUG(0, ("Failed to identify to the monitor!\n"));
- return ret;
- }
-
- return EOK;
-}
-
static void be_target_access_permit(struct be_req *be_req)
{
struct pam_data *pd = talloc_get_type(be_req->req_data, struct pam_data);
@@ -1138,7 +1104,9 @@ int be_process_init(TALLOC_CTX *mem_ctx,
return ret;
}
- ret = mon_cli_init(ctx);
+ ret = sss_monitor_init(ctx, ctx->ev, &monitor_be_interface,
+ ctx->identity, DATA_PROVIDER_VERSION,
+ ctx, &ctx->mon_conn);
if (ret != EOK) {
DEBUG(0, ("fatal error setting up monitor bus\n"));
return ret;