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

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