|
|
ab3a3d |
autofs-5.0.7 - dont fail on master map self include
|
|
|
ab3a3d |
|
|
|
ab3a3d |
From: Ian Kent <raven@themaw.net>
|
|
|
ab3a3d |
|
|
|
ab3a3d |
When reading the master map a self included file map should skip the source
|
|
|
ab3a3d |
and proceed to the next so, in this case, return an nss status that will
|
|
|
ab3a3d |
allow the map read to continue. In particular not NSS_STATUS_UNAVAIL which
|
|
|
ab3a3d |
causes the lookup to record a failure or NSS_STATUS_SUCCESS which indicates
|
|
|
ab3a3d |
a successful lookup and termintes the reading of sources.
|
|
|
ab3a3d |
---
|
|
|
ab3a3d |
CHANGELOG | 1 +
|
|
|
ab3a3d |
modules/lookup_file.c | 7 ++++---
|
|
|
ab3a3d |
2 files changed, 5 insertions(+), 3 deletions(-)
|
|
|
ab3a3d |
|
|
|
ab3a3d |
diff --git a/CHANGELOG b/CHANGELOG
|
|
|
ab3a3d |
index 39388a5..97d6f48 100644
|
|
|
ab3a3d |
--- a/CHANGELOG
|
|
|
ab3a3d |
+++ b/CHANGELOG
|
|
|
ab3a3d |
@@ -28,6 +28,7 @@
|
|
|
ab3a3d |
- make yellow pages support optional.
|
|
|
ab3a3d |
- modules/replicated.c: use sin6_addr.s6_addr32.
|
|
|
ab3a3d |
- workaround missing GNU versionsort extension.
|
|
|
ab3a3d |
+- dont fail on master map self include.
|
|
|
ab3a3d |
|
|
|
ab3a3d |
25/07/2012 autofs-5.0.7
|
|
|
ab3a3d |
=======================
|
|
|
ab3a3d |
diff --git a/modules/lookup_file.c b/modules/lookup_file.c
|
|
|
ab3a3d |
index facb305..f37bed9 100644
|
|
|
ab3a3d |
--- a/modules/lookup_file.c
|
|
|
ab3a3d |
+++ b/modules/lookup_file.c
|
|
|
ab3a3d |
@@ -397,8 +397,9 @@ int lookup_read_master(struct master *master, time_t age, void *context)
|
|
|
ab3a3d |
unsigned int path_len, ent_len;
|
|
|
ab3a3d |
int entry, cur_state;
|
|
|
ab3a3d |
|
|
|
ab3a3d |
+ /* Don't return fail on self include, skip source */
|
|
|
ab3a3d |
if (master->recurse)
|
|
|
ab3a3d |
- return NSS_STATUS_UNAVAIL;
|
|
|
ab3a3d |
+ return NSS_STATUS_TRYAGAIN;
|
|
|
ab3a3d |
|
|
|
ab3a3d |
if (master->depth > MAX_INCLUDE_DEPTH) {
|
|
|
ab3a3d |
error(logopt, MODPREFIX
|
|
|
ab3a3d |
@@ -443,7 +444,7 @@ int lookup_read_master(struct master *master, time_t age, void *context)
|
|
|
ab3a3d |
|
|
|
ab3a3d |
inc = check_master_self_include(master, ctxt);
|
|
|
ab3a3d |
if (inc)
|
|
|
ab3a3d |
- master->recurse = 1;;
|
|
|
ab3a3d |
+ master->recurse = 1;
|
|
|
ab3a3d |
master->depth++;
|
|
|
ab3a3d |
status = lookup_nss_read_master(master, age);
|
|
|
ab3a3d |
if (!status) {
|
|
|
ab3a3d |
@@ -645,7 +646,7 @@ int lookup_read_map(struct autofs_point *ap, time_t age, void *context)
|
|
|
ab3a3d |
mc = source->mc;
|
|
|
ab3a3d |
|
|
|
ab3a3d |
if (source->recurse)
|
|
|
ab3a3d |
- return NSS_STATUS_UNAVAIL;
|
|
|
ab3a3d |
+ return NSS_STATUS_TRYAGAIN;
|
|
|
ab3a3d |
|
|
|
ab3a3d |
if (source->depth > MAX_INCLUDE_DEPTH) {
|
|
|
ab3a3d |
error(ap->logopt,
|