Blame SOURCES/autofs-5.1.6-fix-trailing-dollar-sun-entry-expansion.patch

7d88f3
autofs-5.1.6 - fix trailing dollar sun entry expansion
7d88f3
7d88f3
From: Ian Kent <raven@themaw.net>
7d88f3
7d88f3
In modules/parse_sun.c:expandsunent() if we see "$ " or "$<NULL>" in a
7d88f3
the entry it can't be a macro, and the value can't be quoted since '\'
7d88f3
and '"' cases are handled seperately in the swicth, so treat the
7d88f3
character as a valid entry character.
7d88f3
7d88f3
Signed-off-by: Ian Kent <raven@themaw.net>
7d88f3
---
7d88f3
 CHANGELOG           |    1 +
7d88f3
 modules/parse_sun.c |   12 ++++++++++++
7d88f3
 2 files changed, 13 insertions(+)
7d88f3
7d88f3
--- autofs-5.1.4.orig/CHANGELOG
7d88f3
+++ autofs-5.1.4/CHANGELOG
7d88f3
@@ -77,6 +77,7 @@ xx/xx/2018 autofs-5.1.5
7d88f3
 - use local getmntent_r() in tree_make_mnt_list().
7d88f3
 - fix missing initialization of autofs_point flags.
7d88f3
 - fix a regression with map instance lookup.
7d88f3
+- fix trailing dollar sun entry expansion.
7d88f3
 
7d88f3
 19/12/2017 autofs-5.1.4
7d88f3
 - fix spec file url.
7d88f3
--- autofs-5.1.4.orig/modules/parse_sun.c
7d88f3
+++ autofs-5.1.4/modules/parse_sun.c
7d88f3
@@ -161,6 +161,18 @@ int expandsunent(const char *src, char *
7d88f3
 				}
7d88f3
 				src = p + 1;
7d88f3
 			} else {
7d88f3
+				/* If the '$' is folloed by a space or NULL it
7d88f3
+				 * can't be a macro, and the value can't be
7d88f3
+				 * quoted since '\' and '"' cases are handled
7d88f3
+				 * in other cases, so treat the $ as a valid
7d88f3
+				 * map entry character.
7d88f3
+				 */
7d88f3
+				if (isblank(*src) || !*src) {
7d88f3
+					if (dst)
7d88f3
+						*dst++ = ch;
7d88f3
+					len++;
7d88f3
+					break;
7d88f3
+				}
7d88f3
 				p = src;
7d88f3
 				while (isalnum(*p) || *p == '_')
7d88f3
 					p++;