summaryrefslogtreecommitdiff
path: root/server/responder/common/responder_common.c
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2009-08-17 04:29:47 -0400
committerStephen Gallagher <sgallagh@redhat.com>2009-08-17 09:39:01 -0400
commitc0f3393d4ab923e2eedab0fad88a864e2aae9fc9 (patch)
tree1a31b6e55879396897441545ac5d0278e7371c49 /server/responder/common/responder_common.c
parent7385f34a3c8c68cf0f87d64e55e0ca44f46fdeaa (diff)
downloadsssd-c0f3393d4ab923e2eedab0fad88a864e2aae9fc9.tar.gz
sssd-c0f3393d4ab923e2eedab0fad88a864e2aae9fc9.tar.bz2
sssd-c0f3393d4ab923e2eedab0fad88a864e2aae9fc9.zip
Fix reconnection code
Remove redundant reconnection code that was interfeering with the sbus reconnection code. Consolidate include files for sbus relates operations. Make pamsrv code similar to nsssrv code.
Diffstat (limited to 'server/responder/common/responder_common.c')
-rw-r--r--server/responder/common/responder_common.c36
1 files changed, 35 insertions, 1 deletions
diff --git a/server/responder/common/responder_common.c b/server/responder/common/responder_common.c
index cf06c3ca..f1030c04 100644
--- a/server/responder/common/responder_common.c
+++ b/server/responder/common/responder_common.c
@@ -39,7 +39,6 @@
#include "responder/common/responder.h"
#include "responder/common/responder_packet.h"
#include "providers/data_provider.h"
-#include "monitor/monitor_sbus.h"
#include "monitor/monitor_interfaces.h"
#include "sbus/sbus_client.h"
@@ -318,6 +317,41 @@ static int sss_monitor_init(struct resp_ctx *rctx,
return EOK;
}
+static int sss_dp_init(struct resp_ctx *rctx,
+ struct sbus_interface *intf,
+ uint16_t cli_type, uint16_t cli_version,
+ const char *cli_name, const char *cli_domain)
+{
+ char *sbus_address;
+ int ret;
+
+ /* Set up SBUS connection to the monitor */
+ ret = dp_get_sbus_address(rctx, rctx->cdb, &sbus_address);
+ if (ret != EOK) {
+ DEBUG(0, ("Could not locate DP address.\n"));
+ return ret;
+ }
+
+ ret = sbus_client_init(rctx, rctx->ev, sbus_address,
+ intf, &rctx->dp_conn,
+ NULL, NULL);
+ if (ret != EOK) {
+ DEBUG(0, ("Failed to connect to monitor services.\n"));
+ return ret;
+ }
+
+ /* Identify ourselves to the DP */
+ ret = dp_common_send_id(rctx->dp_conn,
+ cli_type, cli_version,
+ cli_name, cli_domain);
+ if (ret != EOK) {
+ DEBUG(0, ("Failed to identify to the DP!\n"));
+ return ret;
+ }
+
+ return EOK;
+}
+
/* create a unix socket and listen to it */
static int set_unix_socket(struct resp_ctx *rctx)
{