Blame SOURCES/autofs-5.0.7-dont-fail-on-master-map-self-include.patch

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