summaryrefslogtreecommitdiff
path: root/server/responder
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2009-08-05 06:51:07 -0400
committerStephen Gallagher <sgallagh@redhat.com>2009-08-10 09:42:19 -0400
commit0c7050d8569ce7ee61b13d02b4733249a11e171f (patch)
treeab51d15a42dd2049d5a55eed8dbd79945e119050 /server/responder
parent2b0f40eaba44742fa38bb5b67ada510e7b2b6324 (diff)
downloadsssd-0c7050d8569ce7ee61b13d02b4733249a11e171f.tar.gz
sssd-0c7050d8569ce7ee61b13d02b4733249a11e171f.tar.bz2
sssd-0c7050d8569ce7ee61b13d02b4733249a11e171f.zip
Cosmetic changes
Rationalize and rename connection names in preparatoin for merging of server and connection structures.
Diffstat (limited to 'server/responder')
-rw-r--r--server/responder/common/responder.h2
-rw-r--r--server/responder/common/responder_common.c4
-rw-r--r--server/responder/common/responder_dp.c20
-rw-r--r--server/responder/nss/nsssrv.c30
-rw-r--r--server/responder/nss/nsssrv_dp.c4
-rw-r--r--server/responder/pam/pamsrv.c30
-rw-r--r--server/responder/pam/pamsrv_dp.c12
7 files changed, 51 insertions, 51 deletions
diff --git a/server/responder/common/responder.h b/server/responder/common/responder.h
index 408ee4da..5bde42ac 100644
--- a/server/responder/common/responder.h
+++ b/server/responder/common/responder.h
@@ -64,7 +64,7 @@ struct resp_ctx {
const char *sock_name;
const char *priv_sock_name;
- struct sbus_conn_ctx *conn_ctx;
+ struct sbus_connection *conn;
struct sbus_method_ctx *sm_ctx;
struct sss_domain_info *domains;
diff --git a/server/responder/common/responder_common.c b/server/responder/common/responder_common.c
index f8744b67..1fd66907 100644
--- a/server/responder/common/responder_common.c
+++ b/server/responder/common/responder_common.c
@@ -311,7 +311,7 @@ static int sss_sbus_init(struct resp_ctx *rctx)
}
ret = sbus_client_init(rctx, rctx->ev, rctx->sm_ctx,
- sbus_address, &rctx->conn_ctx,
+ sbus_address, &rctx->conn,
NULL, NULL);
if (ret != EOK) {
DEBUG(0, ("Failed to connect to monitor services.\n"));
@@ -497,7 +497,7 @@ int sss_process_init(TALLOC_CTX *mem_ctx,
DEBUG(0, ("fatal error setting up backend connector\n"));
return ret;
}
- else if (!rctx->conn_ctx) {
+ else if (!rctx->conn) {
DEBUG(0, ("Data Provider is not yet available. Retrying.\n"));
return EIO;
}
diff --git a/server/responder/common/responder_dp.c b/server/responder/common/responder_dp.c
index 9083a173..bdd9a9ef 100644
--- a/server/responder/common/responder_dp.c
+++ b/server/responder/common/responder_dp.c
@@ -62,7 +62,7 @@ static void sss_dp_conn_reconnect(struct sss_dp_pvt_ctx *pvt)
}
ret = sbus_client_init(rctx, rctx->ev, rctx->sm_ctx,
- sbus_address, &rctx->conn_ctx,
+ sbus_address, &rctx->conn,
sss_dp_conn_destructor, pvt);
if (ret != EOK) {
DEBUG(4, ("Failed to reconnect [%d(%s)]!\n", ret, strerror(ret)));
@@ -92,15 +92,15 @@ static void sss_dp_reconnect(struct tevent_context *ev,
int sss_dp_conn_destructor(void *data)
{
struct sss_dp_pvt_ctx *pvt;
- struct sbus_conn_ctx *scon;
+ struct sbus_connection *conn;
- scon = talloc_get_type(data, struct sbus_conn_ctx);
- if (!scon) return 0;
+ conn = talloc_get_type(data, struct sbus_connection);
+ if (!conn) return 0;
/* if this is a regular disconnect just quit */
- if (sbus_conn_disconnecting(scon)) return 0;
+ if (sbus_conn_disconnecting(conn)) return 0;
- pvt = talloc_get_type(sbus_conn_get_private_data(scon),
+ pvt = talloc_get_type(sbus_conn_get_private_data(conn),
struct sss_dp_pvt_ctx);
if (pvt) return 0;
@@ -198,7 +198,7 @@ int nss_dp_send_acct_req(struct resp_ctx *rctx, TALLOC_CTX *memctx,
struct nss_dp_req *ndp_req;
DBusMessage *msg;
DBusPendingCall *pending_reply;
- DBusConnection *conn;
+ DBusConnection *dbus_conn;
dbus_bool_t ret;
uint32_t be_type;
const char *attrs = "core";
@@ -243,12 +243,12 @@ int nss_dp_send_acct_req(struct resp_ctx *rctx, TALLOC_CTX *memctx,
* in some pathological cases it may happen that nss starts up before
* dp connection code is actually able to establish a connection.
*/
- if (!rctx->conn_ctx) {
+ if (!rctx->conn) {
DEBUG(1, ("The Data Provider connection is not available yet!"
" This maybe a bug, it shouldn't happen!\n"));
return EIO;
}
- conn = sbus_get_connection(rctx->conn_ctx);
+ dbus_conn = sbus_get_connection(rctx->conn);
/* create the message */
msg = dbus_message_new_method_call(NULL,
@@ -274,7 +274,7 @@ int nss_dp_send_acct_req(struct resp_ctx *rctx, TALLOC_CTX *memctx,
return EIO;
}
- ret = dbus_connection_send_with_reply(conn, msg, &pending_reply,
+ ret = dbus_connection_send_with_reply(dbus_conn, msg, &pending_reply,
600000 /* TODO: set timeout */);
if (!ret || pending_reply == NULL) {
/*
diff --git a/server/responder/nss/nsssrv.c b/server/responder/nss/nsssrv.c
index 419ed1de..d104c7c8 100644
--- a/server/responder/nss/nsssrv.c
+++ b/server/responder/nss/nsssrv.c
@@ -52,10 +52,10 @@
#define SSS_NSS_PIPE_NAME "nss"
-static int service_identity(DBusMessage *message, struct sbus_conn_ctx *sconn);
-static int service_pong(DBusMessage *message, struct sbus_conn_ctx *sconn);
-static int service_reload(DBusMessage *message, struct sbus_conn_ctx *sconn);
-static int service_res_init(DBusMessage *message, struct sbus_conn_ctx *sconn);
+static int service_identity(DBusMessage *message, struct sbus_connection *conn);
+static int service_pong(DBusMessage *message, struct sbus_connection *conn);
+static int service_reload(DBusMessage *message, struct sbus_connection *conn);
+static int service_res_init(DBusMessage *message, struct sbus_connection *conn);
struct sbus_method nss_sbus_methods[] = {
{SERVICE_METHOD_IDENTITY, service_identity},
@@ -65,7 +65,7 @@ struct sbus_method nss_sbus_methods[] = {
{NULL, NULL}
};
-static int service_identity(DBusMessage *message, struct sbus_conn_ctx *sconn)
+static int service_identity(DBusMessage *message, struct sbus_connection *conn)
{
dbus_uint16_t version = NSS_SBUS_SERVICE_VERSION;
const char *name = NSS_SBUS_SERVICE_NAME;
@@ -88,13 +88,13 @@ static int service_identity(DBusMessage *message, struct sbus_conn_ctx *sconn)
}
/* send reply back */
- sbus_conn_send_reply(sconn, reply);
+ sbus_conn_send_reply(conn, reply);
dbus_message_unref(reply);
return EOK;
}
-static int service_pong(DBusMessage *message, struct sbus_conn_ctx *sconn)
+static int service_pong(DBusMessage *message, struct sbus_connection *conn)
{
DBusMessage *reply;
dbus_bool_t ret;
@@ -109,13 +109,13 @@ static int service_pong(DBusMessage *message, struct sbus_conn_ctx *sconn)
}
/* send reply back */
- sbus_conn_send_reply(sconn, reply);
+ sbus_conn_send_reply(conn, reply);
dbus_message_unref(reply);
return EOK;
}
-static int service_reload(DBusMessage *message, struct sbus_conn_ctx *sconn)
+static int service_reload(DBusMessage *message, struct sbus_connection *conn)
{
/* Monitor calls this function when we need to reload
* our configuration information. Perform whatever steps
@@ -123,10 +123,10 @@ static int service_reload(DBusMessage *message, struct sbus_conn_ctx *sconn)
*/
/* Send an empty reply to acknowledge receipt */
- return service_pong(message, sconn);
+ return service_pong(message, conn);
}
-static int service_res_init(DBusMessage *message, struct sbus_conn_ctx *sconn)
+static int service_res_init(DBusMessage *message, struct sbus_connection *conn)
{
int ret;
@@ -135,7 +135,7 @@ static int service_res_init(DBusMessage *message, struct sbus_conn_ctx *sconn)
return EIO;
}
- return service_pong(message, sconn);
+ return service_pong(message, conn);
}
static int nss_get_config(struct nss_ctx *nctx,
@@ -250,7 +250,7 @@ static void nss_shutdown(struct resp_ctx *rctx)
}
-static void nss_dp_reconnect_init(struct sbus_conn_ctx *sconn, int status, void *pvt)
+static void nss_dp_reconnect_init(struct sbus_connection *conn, int status, void *pvt)
{
int ret;
struct resp_ctx *rctx = talloc_get_type(pvt, struct resp_ctx);
@@ -258,7 +258,7 @@ static void nss_dp_reconnect_init(struct sbus_conn_ctx *sconn, int status, void
/* Did we reconnect successfully? */
if (status == SBUS_RECONNECT_SUCCESS) {
/* Add the methods back to the new connection */
- ret = sbus_conn_add_method_ctx(rctx->conn_ctx,
+ ret = sbus_conn_add_method_ctx(rctx->conn,
rctx->sm_ctx);
if (ret != EOK) {
DEBUG(0, ("Could not re-add methods on reconnection.\n"));
@@ -327,7 +327,7 @@ int nss_process_init(TALLOC_CTX *mem_ctx,
return ret;
}
- sbus_reconnect_init(nctx->rctx->conn_ctx,
+ sbus_reconnect_init(nctx->rctx->conn,
max_retries,
nss_dp_reconnect_init, nctx->rctx);
diff --git a/server/responder/nss/nsssrv_dp.c b/server/responder/nss/nsssrv_dp.c
index 943a872c..7150a594 100644
--- a/server/responder/nss/nsssrv_dp.c
+++ b/server/responder/nss/nsssrv_dp.c
@@ -28,7 +28,7 @@
#include "sbus/sbus_client.h"
#include "providers/dp_sbus.h"
-static int nss_dp_identity(DBusMessage *message, struct sbus_conn_ctx *sconn)
+static int nss_dp_identity(DBusMessage *message, struct sbus_connection *conn)
{
dbus_uint16_t version = DATA_PROVIDER_VERSION;
dbus_uint16_t clitype = DP_CLI_FRONTEND;
@@ -55,7 +55,7 @@ static int nss_dp_identity(DBusMessage *message, struct sbus_conn_ctx *sconn)
}
/* send reply back */
- sbus_conn_send_reply(sconn, reply);
+ sbus_conn_send_reply(conn, reply);
dbus_message_unref(reply);
return EOK;
diff --git a/server/responder/pam/pamsrv.c b/server/responder/pam/pamsrv.c
index 05e3a12d..cd423714 100644
--- a/server/responder/pam/pamsrv.c
+++ b/server/responder/pam/pamsrv.c
@@ -55,10 +55,10 @@
#define PAM_SBUS_SERVICE_NAME "pam"
#define PAM_SRV_CONFIG "config/services/pam"
-static int service_identity(DBusMessage *message, struct sbus_conn_ctx *sconn);
-static int service_pong(DBusMessage *message, struct sbus_conn_ctx *sconn);
-static int service_reload(DBusMessage *message, struct sbus_conn_ctx *sconn);
-static int service_res_init(DBusMessage *message, struct sbus_conn_ctx *sconn);
+static int service_identity(DBusMessage *message, struct sbus_connection *conn);
+static int service_pong(DBusMessage *message, struct sbus_connection *conn);
+static int service_reload(DBusMessage *message, struct sbus_connection *conn);
+static int service_res_init(DBusMessage *message, struct sbus_connection *conn);
struct sbus_method sss_sbus_methods[] = {
{SERVICE_METHOD_IDENTITY, service_identity},
@@ -68,7 +68,7 @@ struct sbus_method sss_sbus_methods[] = {
{NULL, NULL}
};
-static int service_identity(DBusMessage *message, struct sbus_conn_ctx *sconn)
+static int service_identity(DBusMessage *message, struct sbus_connection *conn)
{
dbus_uint16_t version = PAM_SBUS_SERVICE_VERSION;
const char *name = PAM_SBUS_SERVICE_NAME;
@@ -90,13 +90,13 @@ static int service_identity(DBusMessage *message, struct sbus_conn_ctx *sconn)
}
/* send reply back */
- sbus_conn_send_reply(sconn, reply);
+ sbus_conn_send_reply(conn, reply);
dbus_message_unref(reply);
return EOK;
}
-static int service_pong(DBusMessage *message, struct sbus_conn_ctx *sconn)
+static int service_pong(DBusMessage *message, struct sbus_connection *conn)
{
DBusMessage *reply;
dbus_bool_t ret;
@@ -110,13 +110,13 @@ static int service_pong(DBusMessage *message, struct sbus_conn_ctx *sconn)
}
/* send reply back */
- sbus_conn_send_reply(sconn, reply);
+ sbus_conn_send_reply(conn, reply);
dbus_message_unref(reply);
return EOK;
}
-static int service_res_init(DBusMessage *message, struct sbus_conn_ctx *sconn)
+static int service_res_init(DBusMessage *message, struct sbus_connection *conn)
{
int ret;
@@ -125,22 +125,22 @@ static int service_res_init(DBusMessage *message, struct sbus_conn_ctx *sconn)
return EIO;
}
- return service_pong(message, sconn);
+ return service_pong(message, conn);
}
static void pam_shutdown(struct resp_ctx *ctx);
-static int service_reload(DBusMessage *message, struct sbus_conn_ctx *sconn) {
+static int service_reload(DBusMessage *message, struct sbus_connection *conn) {
/* Monitor calls this function when we need to reload
* our configuration information. Perform whatever steps
* are needed to update the configuration objects.
*/
/* Send an empty reply to acknowledge receipt */
- return service_pong(message, sconn);
+ return service_pong(message, conn);
}
-static void pam_dp_reconnect_init(struct sbus_conn_ctx *sconn, int status, void *pvt)
+static void pam_dp_reconnect_init(struct sbus_connection *conn, int status, void *pvt)
{
int ret;
struct resp_ctx *rctx = talloc_get_type(pvt, struct resp_ctx);
@@ -148,7 +148,7 @@ static void pam_dp_reconnect_init(struct sbus_conn_ctx *sconn, int status, void
/* Did we reconnect successfully? */
if (status == SBUS_RECONNECT_SUCCESS) {
/* Add the methods back to the new connection */
- ret = sbus_conn_add_method_ctx(rctx->conn_ctx,
+ ret = sbus_conn_add_method_ctx(rctx->conn,
rctx->sm_ctx);
if (ret != EOK) {
DEBUG(0, ("Could not re-add methods on reconnection.\n"));
@@ -190,7 +190,7 @@ static int pam_process_init(struct main_context *main_ctx,
return ret;
}
- sbus_reconnect_init(rctx->conn_ctx, max_retries,
+ sbus_reconnect_init(rctx->conn, max_retries,
pam_dp_reconnect_init, rctx);
return EOK;
diff --git a/server/responder/pam/pamsrv_dp.c b/server/responder/pam/pamsrv_dp.c
index 9703fdbb..c7a536e8 100644
--- a/server/responder/pam/pamsrv_dp.c
+++ b/server/responder/pam/pamsrv_dp.c
@@ -85,19 +85,19 @@ int pam_dp_send_req(struct pam_auth_req *preq, int timeout)
struct pam_data *pd = preq->pd;
DBusMessage *msg;
DBusPendingCall *pending_reply;
- DBusConnection *conn;
+ DBusConnection *dbus_conn;
dbus_bool_t ret;
/* double check dp_ctx has actually been initialized.
* 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_ctx) {
+ if (!preq->cctx->rctx->conn) {
DEBUG(1, ("The Data Provider connection is not available yet!"
" This maybe a bug, it shouldn't happen!\n"));
return EIO;
}
- conn = sbus_get_connection(preq->cctx->rctx->conn_ctx);
+ dbus_conn = sbus_get_connection(preq->cctx->rctx->conn);
msg = dbus_message_new_method_call(NULL,
DP_CLI_PATH,
@@ -118,7 +118,7 @@ int pam_dp_send_req(struct pam_auth_req *preq, int timeout)
return EIO;
}
- ret = dbus_connection_send_with_reply(conn, msg, &pending_reply, timeout);
+ ret = dbus_connection_send_with_reply(dbus_conn, msg, &pending_reply, timeout);
if (!ret || pending_reply == NULL) {
/*
* Critical Failure
@@ -137,7 +137,7 @@ int pam_dp_send_req(struct pam_auth_req *preq, int timeout)
return EOK;
}
-static int pam_dp_identity(DBusMessage *message, struct sbus_conn_ctx *sconn)
+static int pam_dp_identity(DBusMessage *message, struct sbus_connection *conn)
{
dbus_uint16_t version = DATA_PROVIDER_VERSION;
dbus_uint16_t clitype = DP_CLI_FRONTEND;
@@ -163,7 +163,7 @@ static int pam_dp_identity(DBusMessage *message, struct sbus_conn_ctx *sconn)
}
/* send reply back */
- sbus_conn_send_reply(sconn, reply);
+ sbus_conn_send_reply(conn, reply);
dbus_message_unref(reply);
return EOK;