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

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