autofs-5.1.2 - fix quoted key handling in sanitize_path()

From: Ian Kent <raven@themaw.net>

If non-ascii characters are used in a map key then it should be possible
to enclose the map key in quotes so that the validation doesn't choke on
the key.

Signed-off-by: Ian Kent <raven@themaw.net>
---
 CHANGELOG        |    1 +
 lib/parse_subs.c |    8 ++++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index e9c31b4..38c4a2a 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -26,6 +26,7 @@ xx/xx/2016 autofs-5.1.3
 - add master read wait option.
 - work around sss startup delay.
 - add sss master map wait config option.
+- fix quoted key handling in sanitize_path().
 
 15/06/2016 autofs-5.1.2
 =======================
diff --git a/lib/parse_subs.c b/lib/parse_subs.c
index 8520d11..80383c2 100644
--- a/lib/parse_subs.c
+++ b/lib/parse_subs.c
@@ -795,11 +795,15 @@ char *sanitize_path(const char *path, int origlen, unsigned int type, unsigned i
 	unsigned int seen_slash = 0, quote = 0, dquote = 0;
 
 	if (type & (LKP_INDIRECT | LKP_DIRECT)) {
-		slash = strchr(path, '/');
+		char *tmp = path;
+
+		if (*tmp == '"')
+			tmp++;
+		slash = strchr(tmp, '/');
 		if (slash) {
 			if (type == LKP_INDIRECT)
 				return NULL;
-			if (*path != '/')
+			if (*tmp != '/')
 				return NULL;
 		} else {
 			if (type == LKP_DIRECT)