diff options
author | Simo Sorce <ssorce@redhat.com> | 2009-08-05 14:11:12 -0400 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2009-08-10 09:42:20 -0400 |
commit | 11c621b5ee1a0cdc27610f8b172017764acc285e (patch) | |
tree | 181c9079440367711c66d7281fc0aecb458fee77 /server/responder/pam/pamsrv_dp.c | |
parent | f1e4471551aa74015579bff0b64735cc9b085b74 (diff) | |
download | sssd-11c621b5ee1a0cdc27610f8b172017764acc285e.tar.gz sssd-11c621b5ee1a0cdc27610f8b172017764acc285e.tar.bz2 sssd-11c621b5ee1a0cdc27610f8b172017764acc285e.zip |
Simplify interfaces initialization
Make as much as possible static, and remove use of talloc_reference and
allocation/deallocation of memory when not necessary.
Fix also responder use of rctx->conn, was mistakenly used for both
monitor and dp connections.
Diffstat (limited to 'server/responder/pam/pamsrv_dp.c')
-rw-r--r-- | server/responder/pam/pamsrv_dp.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/server/responder/pam/pamsrv_dp.c b/server/responder/pam/pamsrv_dp.c index c7a536e8..c0a286b2 100644 --- a/server/responder/pam/pamsrv_dp.c +++ b/server/responder/pam/pamsrv_dp.c @@ -92,12 +92,12 @@ int pam_dp_send_req(struct pam_auth_req *preq, int timeout) * in some pathological cases it may happen that nss starts up before * dp connection code is actually able to establish a connection. */ - if (!preq->cctx->rctx->conn) { + if (!preq->cctx->rctx->dp_conn) { DEBUG(1, ("The Data Provider connection is not available yet!" " This maybe a bug, it shouldn't happen!\n")); return EIO; } - dbus_conn = sbus_get_connection(preq->cctx->rctx->conn); + dbus_conn = sbus_get_connection(preq->cctx->rctx->dp_conn); msg = dbus_message_new_method_call(NULL, DP_CLI_PATH, @@ -169,12 +169,20 @@ static int pam_dp_identity(DBusMessage *message, struct sbus_connection *conn) return EOK; } -struct sbus_method *register_pam_dp_methods(void) -{ - static struct sbus_method pam_dp_methods[] = { - { DP_CLI_METHOD_IDENTITY, pam_dp_identity }, - { NULL, NULL } - }; +static struct sbus_method pam_dp_methods[] = { + { DP_CLI_METHOD_IDENTITY, pam_dp_identity }, + { NULL, NULL } +}; + +struct sbus_interface pam_dp_interface = { + DATA_PROVIDER_INTERFACE, + DATA_PROVIDER_PATH, + SBUS_DEFAULT_VTABLE, + pam_dp_methods, + NULL +}; - return pam_dp_methods; +struct sbus_interface *get_pam_dp_interface(void) +{ + return &pam_dp_interface; } |