From: Andreas Schwab Date: Thu, 4 Apr 2002 13:35:05 +0000 (+0000) Subject: * lib/m4sugar/m4sh.m4 (_AS_PATH_WALK): Only simplify if path X-Git-Tag: AUTOCONF-2.53a~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=193f800800bcd84cc552453c4dd92e712e2740f2;p=thirdparty%2Fautoconf.git * lib/m4sugar/m4sh.m4 (_AS_PATH_WALK): Only simplify if path contains no literal separators. --- diff --git a/ChangeLog b/ChangeLog index 5f8039c94..df99423ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-04-04 Andreas Schwab + + * lib/m4sugar/m4sh.m4 (_AS_PATH_WALK): Only simplify if path + contains no literal separators. + 2002-04-03 Akim Demaille * lib/autoconf/status.m4 (_AC_CONFIG_FILE, _AC_CONFIG_HEADER) diff --git a/lib/m4sugar/m4sh.m4 b/lib/m4sugar/m4sh.m4 index 85b3cf414..ccba5accf 100644 --- a/lib/m4sugar/m4sh.m4 +++ b/lib/m4sugar/m4sh.m4 @@ -626,13 +626,14 @@ fi # Still very private as its interface looks quite bad. # # `$as_dummy' forces splitting on constant user-supplied paths. -# POSIX.2 word splitting is done only on the output of word -# expansions, not every word. This closes a longstanding sh security -# hole. Optimize it away when not needed. +# POSIX.2 field splitting is done only on the result of word +# expansions, not on literal text. This closes a longstanding sh security +# hole. Optimize it away when not needed, i.e., if there are no literal +# path separators. m4_define([_AS_PATH_WALK], [AS_REQUIRE([_AS_PATH_SEPARATOR_PREPARE])dnl as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -AS_LITERAL_IF(m4_default([$1], [$PATH]), +m4_bmatch([$1], [[:;]], [as_dummy="$1" for as_dir in $as_dummy], [for as_dir in m4_default([$1], [$PATH])])