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

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