Blame SOURCES/autofs-5.0.7-make-dump-maps-check-for-duplicate-indirect-mounts.patch

304803
autofs-5.0.7 - make dump maps check for duplicate indirect mounts
304803
304803
From: Ian Kent <raven@themaw.net>
304803
304803
The dumpmaps function was intended for users to find out how the configured
304803
mounts would be seen by automount. It does a limited amount of checking and
304803
in particular doesn't report that duplicate indirect map sources will be
304803
ignored at runtime.
304803
---
304803
 CHANGELOG    |    1 +
304803
 lib/master.c |    7 +++++++
304803
 2 files changed, 8 insertions(+)
304803
304803
diff --git a/CHANGELOG b/CHANGELOG
304803
index 4106e7f..4576d47 100644
304803
--- a/CHANGELOG
304803
+++ b/CHANGELOG
304803
@@ -40,6 +40,7 @@
304803
 - fix some automount(8) typos.
304803
 - syncronize handle_mounts() shutdown.
304803
 - fix submount tree not all expiring.
304803
+- make dump maps check for duplicate indirect mounts.
304803
 
304803
 25/07/2012 autofs-5.0.7
304803
 =======================
304803
diff --git a/lib/master.c b/lib/master.c
304803
index 64dbcb1..eca3523 100644
304803
--- a/lib/master.c
304803
+++ b/lib/master.c
304803
@@ -1310,6 +1310,7 @@ int master_show_mounts(struct master *master)
304803
 		struct master_mapent *this;
304803
 		struct autofs_point *ap;
304803
 		time_t now = time(NULL);
304803
+		unsigned int count = 0;
304803
 		int i;
304803
 
304803
 		this = list_entry(p, struct master_mapent, list);
304803
@@ -1318,6 +1319,7 @@ int master_show_mounts(struct master *master)
304803
 		ap = this->ap;
304803
 
304803
 		printf("\nMount point: %s\n", ap->path);
304803
+
304803
 		printf("\nsource(s):\n");
304803
 
304803
 		/*
304803
@@ -1360,6 +1362,9 @@ int master_show_mounts(struct master *master)
304803
 					printf("  map: %s\n", source->argv[0]);
304803
 					i = 1;
304803
 				}
304803
+				if (count && ap->type == LKP_INDIRECT)
304803
+					printf("  duplicate indirect map entry"
304803
+					       " will be ignored at run time\n");
304803
 				if (source->argc > 1) {
304803
 					printf("  arguments: ");
304803
 					for (; i < source->argc; i++)
304803
@@ -1379,6 +1384,8 @@ int master_show_mounts(struct master *master)
304803
 				} while ((me = cache_lookup_next(source->mc, me)));
304803
 			}
304803
 
304803
+			count++;
304803
+
304803
 			source = source->next;
304803
 		}
304803