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

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