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

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