Blame SOURCES/autofs-5.1.1-fix-nsswitch-handling-when-opening-multi-map.patch

304803
autofs-5.1.1 - fix nsswitch handling when opening multi map
304803
304803
From: Ian Kent <raven@themaw.net>
304803
304803
When initializing the lookup module for multi-map entries nsswitch
304803
actions should be honoured to the extent they can be. In particular
304803
the case of a map not found should use an nsswitch action (if present)
304803
to work out whether to continue looking or return a failure.
304803
304803
Signed-off-by: Ian Kent <raven@themaw.net>
304803
---
304803
 modules/lookup_multi.c |    9 +++++++++
304803
 1 file changed, 9 insertions(+)
304803
304803
diff --git a/modules/lookup_multi.c b/modules/lookup_multi.c
304803
index 55035e4..ba8d4f0 100644
304803
--- a/modules/lookup_multi.c
304803
+++ b/modules/lookup_multi.c
304803
@@ -84,6 +84,7 @@ static struct lookup_mod *nss_open_lookup(const char *format, int argc, const ch
304803
 	list_for_each(p, head) {
304803
 		struct nss_source *this;
304803
 		int status;
304803
+		int ret;
304803
 
304803
 		this = list_entry(p, struct nss_source, list);
304803
 
304803
@@ -127,6 +128,10 @@ static struct lookup_mod *nss_open_lookup(const char *format, int argc, const ch
304803
 
304803
 			argv[0] = save_argv0;
304803
 			free(path);
304803
+
304803
+			ret = check_nss_result(this, status);
304803
+			if (ret >= 0)
304803
+				break;
304803
 		}
304803
 
304803
 		status = open_lookup(this->source, MODPREFIX,
304803
@@ -135,6 +140,10 @@ static struct lookup_mod *nss_open_lookup(const char *format, int argc, const ch
304803
 			free_sources(&nsslist);
304803
 			return mod;
304803
 		}
304803
+
304803
+		ret = check_nss_result(this, status);
304803
+		if (ret >= 0)
304803
+			break;
304803
 	}
304803
 	free_sources(&nsslist);
304803