Blame SOURCES/autofs-5.1.6-add-sss-ECONREFUSED-return-handling.patch

63b9c2
autofs-5.1.6 - add sss ECONREFUSED return handling
63b9c2
63b9c2
From: Ian Kent <raven@themaw.net>
63b9c2
63b9c2
The sss library has returned ECONNREFUSED for the case of sssd not
63b9c2
running for a long time now but autofs doesn't catch it, fix that.
63b9c2
63b9c2
Signed-off-by: Ian Kent <raven@themaw.net>
63b9c2
---
63b9c2
 CHANGELOG            |    1 +
63b9c2
 modules/lookup_sss.c |    9 +++++++++
63b9c2
 2 files changed, 10 insertions(+)
63b9c2
63b9c2
diff --git a/CHANGELOG b/CHANGELOG
63b9c2
index 5a3d785..2a45829 100644
63b9c2
--- a/CHANGELOG
63b9c2
+++ b/CHANGELOG
63b9c2
@@ -94,6 +94,7 @@ xx/xx/2018 autofs-5.1.5
63b9c2
 - fix lookup_nss_read_master() nsswicth check return.
63b9c2
 - fix typo in open_sss_lib().
63b9c2
 - fix sss_master_map_wait timing.
63b9c2
+- add sss ECONREFUSED return handling.
63b9c2
 
63b9c2
 19/12/2017 autofs-5.1.4
63b9c2
 - fix spec file url.
63b9c2
diff --git a/modules/lookup_sss.c b/modules/lookup_sss.c
63b9c2
index fbb6193..c393296 100644
63b9c2
--- a/modules/lookup_sss.c
63b9c2
+++ b/modules/lookup_sss.c
63b9c2
@@ -297,6 +297,9 @@ int lookup_read_master(struct master *master, time_t age, void *context)
63b9c2
 	if (ret) {
63b9c2
 		unsigned int retries;
63b9c2
 
63b9c2
+		if (ret == ECONNREFUSED)
63b9c2
+			return NSS_STATUS_UNKNOWN;
63b9c2
+
63b9c2
 		if (ret != ENOENT)
63b9c2
 			return NSS_STATUS_UNAVAIL;
63b9c2
 
63b9c2
@@ -308,6 +311,8 @@ int lookup_read_master(struct master *master, time_t age, void *context)
63b9c2
 					 ctxt, ctxt->mapname, &sss_ctxt,
63b9c2
 					 retries);
63b9c2
 		if (ret) {
63b9c2
+			if (ret == ECONNREFUSED)
63b9c2
+				return NSS_STATUS_UNKNOWN;
63b9c2
 			if (ret == ENOENT)
63b9c2
 				return NSS_STATUS_NOTFOUND;
63b9c2
 			return NSS_STATUS_UNAVAIL;
63b9c2
@@ -415,6 +420,8 @@ int lookup_read_map(struct autofs_point *ap, time_t age, void *context)
63b9c2
 
63b9c2
 	ret = setautomntent(ap->logopt, ctxt, ctxt->mapname, &sss_ctxt);
63b9c2
 	if (ret) {
63b9c2
+		if (ret == ECONNREFUSED)
63b9c2
+			return NSS_STATUS_UNKNOWN;
63b9c2
 		if (ret == ENOENT)
63b9c2
 			return NSS_STATUS_NOTFOUND;
63b9c2
 		return NSS_STATUS_UNAVAIL;
63b9c2
@@ -525,6 +532,8 @@ static int lookup_one(struct autofs_point *ap,
63b9c2
 
63b9c2
 	ret = setautomntent(ap->logopt, ctxt, ctxt->mapname, &sss_ctxt);
63b9c2
 	if (ret) {
63b9c2
+		if (ret == ECONNREFUSED)
63b9c2
+			return NSS_STATUS_UNKNOWN;
63b9c2
 		if (ret == ENOENT)
63b9c2
 			return NSS_STATUS_NOTFOUND;
63b9c2
 		return NSS_STATUS_UNAVAIL;