Blame SOURCES/autofs-5.1.4-dont-allow-trailing-slash-in-master-map-mount-points.patch

304803
autofs-5.1.4 - dont allow trailing slash in master map mount points
304803
304803
From: Ian Kent <raven@themaw.net>
304803
304803
If a master map mount point path has a trailing '/' this can cause
304803
problems so remove them at parse time.
304803
304803
Signed-off-by: Ian Kent <raven@themaw.net>
304803
---
304803
 CHANGELOG          |    1 +
304803
 lib/master_parse.y |    5 +++++
304803
 2 files changed, 6 insertions(+)
304803
304803
--- autofs-5.0.7.orig/CHANGELOG
304803
+++ autofs-5.0.7/CHANGELOG
304803
@@ -296,6 +296,7 @@
304803
 - fix sublink option not set from defaults.
304803
 - fix error return in do_nfs_mount().
304803
 - fix create_client() RPC client handling.
304803
+- dont allow trailing slash in master map mount points.
304803
 
304803
 25/07/2012 autofs-5.0.7
304803
 =======================
304803
--- autofs-5.0.7.orig/lib/master_parse.y
304803
+++ autofs-5.0.7/lib/master_parse.y
304803
@@ -744,6 +744,7 @@ int master_parse_entry(const char *buffe
304803
 	struct map_source *source;
304803
 	unsigned int logopt = logging;
304803
 	unsigned int m_logopt = master->logopt;
304803
+	size_t mp_len;
304803
 	int ret;
304803
 
304803
 	local_init_vars();
304803
@@ -758,6 +759,10 @@ int master_parse_entry(const char *buffe
304803
 		return 0;
304803
 	}
304803
 
304803
+	mp_len = strlen(path);
304803
+	while (mp_len && path[--mp_len] == '/')
304803
+		path[mp_len] = 0;
304803
+
304803
 	nc = master->nc;
304803
 
304803
 	/* Add null map entries to the null map cache */