summaryrefslogtreecommitdiff
path: root/server/util
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2008-12-08 19:07:56 -0500
committerSimo Sorce <idra@samba.org>2008-12-08 19:25:21 -0500
commit8f86577722f9e880c82e7a98fcb14ee06acb7170 (patch)
tree2a4ed81a4c55c13cf93812fe7a577f081f4613b4 /server/util
parent6092cf59d7f5d1c0d915c65bde20fdc98f80c950 (diff)
downloadsssd-8f86577722f9e880c82e7a98fcb14ee06acb7170.tar.gz
sssd-8f86577722f9e880c82e7a98fcb14ee06acb7170.tar.bz2
sssd-8f86577722f9e880c82e7a98fcb14ee06acb7170.zip
Change data provider into a hub, where backends (ldap, nis, ipa providers)
and frontends (pam, nss, ... modules) can connect to.
Diffstat (limited to 'server/util')
-rw-r--r--server/util/server.c5
-rw-r--r--server/util/service_helpers.c21
-rw-r--r--server/util/service_helpers.h3
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_*/