]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
m4sh: fix some namespace safety issues
authorEric Blake <eblake@redhat.com>
Wed, 25 Aug 2010 22:21:39 +0000 (16:21 -0600)
committerEric Blake <eblake@redhat.com>
Wed, 25 Aug 2010 22:21:39 +0000 (16:21 -0600)
* lib/m4sugar/m4sh.m4 (_AS_SHELL_SANITIZE): Avoid problems if
as_myself is inherited from environment.
(AS_TMPDIR): Be namespace clean.

Signed-off-by: Eric Blake <eblake@redhat.com>
ChangeLog
lib/m4sugar/m4sh.m4

index c7ef728e68a07dfde50b31ba5cb546e7c5340e40..569d7ad96d5b388dcc46c27065ee321b9f42fc1b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-08-25  Eric Blake  <eblake@redhat.com>
+
+       m4sh: fix some namespace safety issues
+       * lib/m4sugar/m4sh.m4 (_AS_SHELL_SANITIZE): Avoid problems if
+       as_myself is inherited from environment.
+       (AS_TMPDIR): Be namespace clean.
+
 2010-08-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        tests: fix AC_CACHE_CHECK to skip with bad shells.
index 3cc868cf53627787ac014897db7cebd71962cf9a..15dd80d1292ea51632904590bc119d01498e2185 100644 (file)
@@ -425,6 +425,7 @@ _AS_PATH_SEPARATOR_PREPARE
 IFS=" ""       $as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
 case $[0] in @%:@((
   *[[\\/]]* ) as_myself=$[0] ;;
   *) _AS_PATH_WALK([],
@@ -1618,12 +1619,13 @@ m4_define([AS_TMPDIR],
 [# Create a (secure) tmp directory for tmp files.
 m4_if([$2], [], [: ${TMPDIR=/tmp}])
 {
-  tmp=`(umask 077 && mktemp -d "m4_default([$2], [$TMPDIR])/$1XXXXXX") 2>/dev/null` &&
-  test -n "$tmp" && test -d "$tmp"
+  as_tmp=`(umask 077 && mktemp -d "m4_default([$2],
+    [$TMPDIR])/$1XXXXXX") 2>/dev/null` &&
+  test -d "$as_tmp"
 }  ||
 {
-  tmp=m4_default([$2], [$TMPDIR])/$1$$-$RANDOM
-  (umask 077 && mkdir "$tmp")
+  as_tmp=m4_default([$2], [$TMPDIR])/$1$$-$RANDOM
+  (umask 077 && mkdir "$as_tmp")
 } || AS_ERROR([cannot create a temporary directory in m4_default([$2],
              [$TMPDIR])])])# AS_TMPDIR