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

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