summaryrefslogtreecommitdiff
path: root/server/responder/pam
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2009-03-27 13:53:16 -0400
committerSimo Sorce <ssorce@redhat.com>2009-03-27 13:54:25 -0400
commit11cd9b94e6fc6ce22387a49f146f875c03bf9b54 (patch)
tree077b708b35231700474e7eaed5f36c7ad7aea4cc /server/responder/pam
parenta19c42b15aff752310a6a6bb43d0e62534e8d117 (diff)
downloadsssd-11cd9b94e6fc6ce22387a49f146f875c03bf9b54.tar.gz
sssd-11cd9b94e6fc6ce22387a49f146f875c03bf9b54.tar.bz2
sssd-11cd9b94e6fc6ce22387a49f146f875c03bf9b54.zip
Make nsssrv use the common responder functions
Make nss_ctx a private pointer of the common resp_ctx Use sss_process_init and remove all duplicate functions from nsssrv.c
Diffstat (limited to 'server/responder/pam')
-rw-r--r--server/responder/pam/pamsrv.c11
-rw-r--r--server/responder/pam/pamsrv_cmd.c9
2 files changed, 8 insertions, 12 deletions
diff --git a/server/responder/pam/pamsrv.c b/server/responder/pam/pamsrv.c
index 4abc0a2f..d653a008 100644
--- a/server/responder/pam/pamsrv.c
+++ b/server/responder/pam/pamsrv.c
@@ -48,7 +48,7 @@
#define PAM_SBUS_SERVICE_VERSION 0x0001
#define PAM_SBUS_SERVICE_NAME "pam"
-#define CONFDB_SOCKET_PATH "config/services/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);
@@ -161,7 +161,10 @@ static int pam_process_init(struct main_context *main_ctx,
int ret, max_retries;
/* Enable automatic reconnection to the Data Provider */
- ret = confdb_get_int(rctx->cdb, rctx, rctx->confdb_socket_path,
+
+ /* FIXME: "retries" is too generic, either get it from a global config
+ * or specify these retries are about the sbus connections to DP */
+ ret = confdb_get_int(rctx->cdb, rctx, rctx->confdb_service_path,
"retries", 3, &max_retries);
if (ret != EOK) {
DEBUG(0, ("Failed to set up automatic reconnection\n"));
@@ -204,7 +207,7 @@ int main(int argc, const char *argv[])
poptFreeContext(pc);
/* set up things like debug , signals, daemonization, etc... */
- ret = server_setup("sssd[pam]", 0, CONFDB_SOCKET_PATH, &main_ctx);
+ ret = server_setup("sssd[pam]", 0, PAM_SRV_CONFIG, &main_ctx);
if (ret != EOK) return 2;
pam_dp_methods = register_pam_dp_methods();
@@ -216,7 +219,7 @@ int main(int argc, const char *argv[])
sss_cmds,
SSS_PAM_SOCKET_NAME,
SSS_PAM_PRIV_SOCKET_NAME,
- CONFDB_SOCKET_PATH,
+ PAM_SRV_CONFIG,
pam_dp_methods,
&rctx);
if (ret != EOK) return 3;
diff --git a/server/responder/pam/pamsrv_cmd.c b/server/responder/pam/pamsrv_cmd.c
index 1f7be166..06a230b6 100644
--- a/server/responder/pam/pamsrv_cmd.c
+++ b/server/responder/pam/pamsrv_cmd.c
@@ -134,13 +134,6 @@ static void pam_reply(struct pam_data *pd)
}
cctx = pd->cctx;
- rctx = talloc_zero(cctx, struct sss_cmd_ctx);
- if (!rctx) {
- err = ENOMEM;
- goto done;
- }
- rctx->cctx = cctx;
- rctx->check_expiration = true;
ret = sss_packet_new(cctx->creq, 0, sss_packet_get_cmd(cctx->creq->in),
&cctx->creq->out);
@@ -196,7 +189,7 @@ static void pam_reply(struct pam_data *pd)
done:
talloc_free(pd);
- sss_cmd_done(rctx);
+ sss_cmd_done(cctx, NULL);
}
static int pam_forwarder(struct cli_ctx *cctx, int pam_cmd)