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