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

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