summaryrefslogtreecommitdiff
path: root/server/responder/nss
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/nss
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/nss')
-rw-r--r--server/responder/nss/nsssrv.c40
1 files changed, 24 insertions, 16 deletions
diff --git a/server/responder/nss/nsssrv.c b/server/responder/nss/nsssrv.c
index 456c6292..a896ef31 100644
--- a/server/responder/nss/nsssrv.c
+++ b/server/responder/nss/nsssrv.c
@@ -41,7 +41,6 @@
#include "util/btreemap.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"
@@ -186,35 +185,44 @@ static void nss_shutdown(struct resp_ctx *rctx)
exit(0);
}
+static struct sbus_method nss_dp_methods[] = {
+ { NULL, NULL }
+};
-static void nss_dp_reconnect_init(struct sbus_connection *conn, int status, void *pvt)
+struct sbus_interface nss_dp_interface = {
+ DP_CLI_INTERFACE,
+ DP_CLI_PATH,
+ SBUS_DEFAULT_VTABLE,
+ nss_dp_methods,
+ NULL
+};
+
+
+static void nss_dp_reconnect_init(struct sbus_connection *conn,
+ int status, void *pvt)
{
struct resp_ctx *rctx = talloc_get_type(pvt, struct resp_ctx);
+ int ret;
/* Did we reconnect successfully? */
if (status == SBUS_RECONNECT_SUCCESS) {
DEBUG(1, ("Reconnected to the Data Provider.\n"));
- return;
+
+ /* Identify ourselves to the data provider */
+ ret = dp_common_send_id(conn,
+ DP_CLI_FRONTEND,
+ DATA_PROVIDER_VERSION,
+ "NSS", "");
+ /* all fine */
+ if (ret == EOK) return;
}
- /* Handle failure */
+ /* Failed to reconnect */
DEBUG(0, ("Could not reconnect to data provider.\n"));
/* Kill the backend and let the monitor restart it */
nss_shutdown(rctx);
}
-static struct sbus_method nss_dp_methods[] = {
- { NULL, NULL }
-};
-
-struct sbus_interface nss_dp_interface = {
- DP_CLI_INTERFACE,
- DP_CLI_PATH,
- SBUS_DEFAULT_VTABLE,
- nss_dp_methods,
- NULL
-};
-
int nss_process_init(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct confdb_ctx *cdb)