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

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