From e521e176c11f7cd2e7cb4220120e415f3728bdfb Mon Sep 17 00:00:00 2001 From: Packit Service Date: Dec 11 2020 22:13:21 +0000 Subject: Apply patch autofs-5.1.6-fix-trailing-dollar-sun-entry-expansion.patch patch_name: autofs-5.1.6-fix-trailing-dollar-sun-entry-expansion.patch present_in_specfile: true --- diff --git a/CHANGELOG b/CHANGELOG index e5ac879..5113b94 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -77,6 +77,7 @@ xx/xx/2018 autofs-5.1.5 - use local getmntent_r() in tree_make_mnt_list(). - fix missing initialization of autofs_point flags. - fix a regression with map instance lookup. +- fix trailing dollar sun entry expansion. 19/12/2017 autofs-5.1.4 - fix spec file url. diff --git a/modules/parse_sun.c b/modules/parse_sun.c index 88dde0b..bfb4c84 100644 --- a/modules/parse_sun.c +++ b/modules/parse_sun.c @@ -161,6 +161,18 @@ int expandsunent(const char *src, char *dst, const char *key, } src = p + 1; } else { + /* If the '$' is folloed by a space or NULL it + * can't be a macro, and the value can't be + * quoted since '\' and '"' cases are handled + * in other cases, so treat the $ as a valid + * map entry character. + */ + if (isblank(*src) || !*src) { + if (dst) + *dst++ = ch; + len++; + break; + } p = src; while (isalnum(*p) || *p == '_') p++;