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