[SSSD] [PATCH] Allow sssd clients to reconnect

Sumit Bose sbose at redhat.com
Fri Jul 23 13:54:03 UTC 2010


Hi,

if sssd is restarted NSS clients will loose the connection to sssd. This
patch tries to reopen the socket if there is an error on the socket and
should fix
https://bugzilla.redhat.com/show_bug.cgi?id=607233 and
https://fedorahosted.org/sssd/ticket/571

bye,
Sumit
-------------- next part --------------
>From 42db546eb0dd302285d4d783d2fc19fbc9e9b93c Mon Sep 17 00:00:00 2001
From: Sumit Bose <sbose at redhat.com>
Date: Fri, 23 Jul 2010 15:45:46 +0200
Subject: [PATCH] Allow sssd clients to reconnect

Currently the PAM and NSS client just return an error if there are
problems on an open socket. This will lead to problems in long running
programs like gdm if sssd is restarted, e.g. during an update. With this
patch the socket is closed and reopened.
---
 src/sss_client/common.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/sss_client/common.c b/src/sss_client/common.c
index a4856e0..6b79c78 100644
--- a/src/sss_client/common.c
+++ b/src/sss_client/common.c
@@ -607,12 +607,11 @@ static enum sss_status sss_cli_check_socket(int *errnop, const char *socket_name
             *errnop = EBADF;
             break;
         }
-        if (*errnop) {
-            sss_cli_close_socket();
-            return SSS_STATUS_UNAVAIL;
+        if (*errnop == 0) {
+            return SSS_STATUS_SUCCESS;
         }
 
-        return SSS_STATUS_SUCCESS;
+        sss_cli_close_socket();
     }
 
     mysd = sss_nss_open_socket(errnop, socket_name);
-- 
1.7.1.1



More information about the sssd-devel mailing list