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

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