From 00e37fabf39b5c453c4fa97af3718f6055ee899f Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Wed, 18 Jun 1997 22:28:50 +0000 Subject: [PATCH] * acgeneral.m4 (AC_CHECK_PROG, AC_PATH_PROG): Assign the path to ac_dummy and then expand it, rather than simply tacking on $ac_dummy to the path. This works around POSIX.2 word splitting semantics, in which even things like a:b:c:$PATH don't get word-split as you might expect on a pre-POSIX shell. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10099 dc483132-0cff-0310-8789-dd5450dbe970 --- src/util/autoconf/ChangeLog | 8 ++++++++ src/util/autoconf/acgeneral.m4 | 10 ++++++---- src/util/autoconf/configure | 15 +++++++++------ 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/src/util/autoconf/ChangeLog b/src/util/autoconf/ChangeLog index 8415c4863..94ad35048 100644 --- a/src/util/autoconf/ChangeLog +++ b/src/util/autoconf/ChangeLog @@ -1,3 +1,11 @@ +Wed Jun 18 16:13:11 1997 Tom Yu + + * acgeneral.m4 (AC_CHECK_PROG, AC_PATH_PROG): Assign the path to + ac_dummy and then expand it, rather than simply tacking on + $ac_dummy to the path. This works around POSIX.2 word splitting + semantics, in which even things like a:b:c:$PATH don't get + word-split as you might expect on a pre-POSIX shell. + Tue Nov 26 13:00:28 1996 David J MacKenzie * Version 2.12. diff --git a/src/util/autoconf/acgeneral.m4 b/src/util/autoconf/acgeneral.m4 index fee0215d9..a343b9ac6 100644 --- a/src/util/autoconf/acgeneral.m4 +++ b/src/util/autoconf/acgeneral.m4 @@ -1280,9 +1280,10 @@ else ifelse([$6], , , [ ac_prog_rejected=no ])dnl dnl $ac_dummy forces splitting on constant user-supplied paths. -dnl bash word splitting is done only on the output of word expansions, +dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. - for ac_dir in ifelse([$5], , $PATH, [$5$ac_dummy]); do + ac_dummy=ifelse([$5], , $PATH, [$5]) + for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ifelse([$6], , , dnl @@ -1344,9 +1345,10 @@ AC_CACHE_VAL(ac_cv_path_$1, *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" dnl $ac_dummy forces splitting on constant user-supplied paths. -dnl bash word splitting is done only on the output of word expansions, +dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. - for ac_dir in ifelse([$4], , $PATH, [$4$ac_dummy]); do + ac_dummy=ifelse([$4], , $PATH, [$4]) + for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_$1="$ac_dir/$ac_word" diff --git a/src/util/autoconf/configure b/src/util/autoconf/configure index 9f04e77a3..a0a4e7098 100644 --- a/src/util/autoconf/configure +++ b/src/util/autoconf/configure @@ -554,7 +554,8 @@ else ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do + ac_dummy=$PATH + for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_M4="$ac_dir/$ac_word" @@ -581,7 +582,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:585: checking for $ac_word" >&5 +echo "configure:586: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -589,7 +590,8 @@ else ac_cv_prog_AWK="$AWK" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do + ac_dummy=$PATH + for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_AWK="$ac_prog" @@ -613,7 +615,7 @@ done # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:617: checking for $ac_word" >&5 +echo "configure:619: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -623,7 +625,8 @@ else ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do + ac_dummy=$PATH + for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_PERL="$ac_dir/$ac_word" @@ -678,7 +681,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:682: checking for a BSD compatible install" >&5 +echo "configure:685: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -- 2.26.2