opensubscriber
   Find in this group all groups
 
Unknown more information…

a : autoconf-patches@gnu.org 26 August 2010 • 7:18AM -0400

[PATCH 1/5] m4sh: fix some namespace safety issues
by Eric Blake

REPLY TO AUTHOR
 
REPLY TO GROUP




* 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@redh...>
---

We shouldn't clobber $tmp without good reason.  test -d '' reliably
fails, so it makes test -n "$as_tmp" wasted effort.  And although the
user shouldn't be exporting anything in the as_ namespace, it
can't hurt to be a bit more careful.

ChangeLog           |    7 +++++++
lib/m4sugar/m4sh.m4 |   10 ++++++----
2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c7ef728..569d7ad 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-08-25  Eric Blake  <eblake@redh...>
+
+ 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....>

tests: fix AC_CACHE_CHECK to skip with bad shells.
diff --git a/lib/m4sugar/m4sh.m4 b/lib/m4sugar/m4sh.m4
index 3cc868c..15dd80d 100644
--- a/lib/m4sugar/m4sh.m4
+++ b/lib/m4sugar/m4sh.m4
@@ -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

--
1.7.2.2



Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.