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

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