diff options
Diffstat (limited to 'server/util')
-rw-r--r-- | server/util/server.c | 5 | ||||
-rw-r--r-- | server/util/service_helpers.c | 21 | ||||
-rw-r--r-- | server/util/service_helpers.h | 3 |
3 files changed, 8 insertions, 21 deletions
diff --git a/server/util/server.c b/server/util/server.c index def44f03..6983fcaa 100644 --- a/server/util/server.c +++ b/server/util/server.c @@ -242,7 +242,10 @@ int server_setup(const char *name, int flags, uint16_t stdin_event_flags; int ret = EOK; - debug_prg_name = name; + debug_prg_name = strdup(name); + if (!debug_prg_name) { + return ENOMEM; + } setup_signals(); diff --git a/server/util/service_helpers.c b/server/util/service_helpers.c index 62321083..1630946f 100644 --- a/server/util/service_helpers.c +++ b/server/util/service_helpers.c @@ -33,8 +33,7 @@ struct service_sbus_ctx *sssd_service_sbus_init(TALLOC_CTX *mem_ctx, struct event_context *ev, struct confdb_ctx *cdb, - sbus_msg_handler_fn get_identity, - sbus_msg_handler_fn ping) + struct sbus_method *methods) { struct service_sbus_ctx *ss_ctx; struct sbus_method_ctx *sm_ctx; @@ -75,22 +74,8 @@ struct service_sbus_ctx *sssd_service_sbus_init(TALLOC_CTX *mem_ctx, sm_ctx->path = talloc_strdup(sm_ctx, SERVICE_PATH); if (!sm_ctx->interface || !sm_ctx->path) goto error; - /* Set up required monitor methods */ - sm_ctx->methods = talloc_array(sm_ctx, struct sbus_method, 3); - if (sm_ctx->methods == NULL) goto error; - - /* Handle getIdentity */ - sm_ctx->methods[0].method = SERVICE_METHOD_IDENTITY; - sm_ctx->methods[0].fn = get_identity; - - /* Handle ping */ - sm_ctx->methods[1].method = SERVICE_METHOD_PING; - sm_ctx->methods[1].fn = ping; - - /* Terminate the list */ - sm_ctx->methods[2].method = NULL; - sm_ctx->methods[2].fn = NULL; - + /* Set up required monitor methods and handlers */ + sm_ctx->methods = methods; sm_ctx->message_handler = sbus_message_handler; sbus_conn_add_method_ctx(ss_ctx->scon_ctx, sm_ctx); diff --git a/server/util/service_helpers.h b/server/util/service_helpers.h index 440186db..f2701d51 100644 --- a/server/util/service_helpers.h +++ b/server/util/service_helpers.h @@ -33,7 +33,6 @@ struct service_sbus_ctx { struct service_sbus_ctx *sssd_service_sbus_init(TALLOC_CTX *mem_ctx, struct event_context *ev, struct confdb_ctx *cdb, - sbus_msg_handler_fn get_identity, - sbus_msg_handler_fn ping); + struct sbus_method *methods); #endif /*SERVICE_HELPERS_H_*/ |