]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* lib/m4sugar/m4sugar.m4 (m4_mkstemp): New macro.
authorEric Blake <ebb9@byu.net>
Fri, 20 Oct 2006 01:34:32 +0000 (01:34 +0000)
committerEric Blake <ebb9@byu.net>
Fri, 20 Oct 2006 01:34:32 +0000 (01:34 +0000)
(m4_maketemp): Avoid warnings with M4 1.9a.
* lib/emacs/autoconf-mode.el (autoconf-font-lock-keywords): Color
m4_mkstemp.
* doc/autoconf.texi (Redefined M4 Macros): Document m4_mkstemp.
* NEWS: Likewise.

ChangeLog
NEWS
doc/autoconf.texi
lib/emacs/autoconf-mode.el
lib/m4sugar/m4sugar.m4

index 6aaa1e4c920b84e5545b608e5f7ee05203bc5987..d98788978b88c694e919039f0f0c8aeb42c95426 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2006-10-19  Eric Blake  <ebb9@byu.net>
+
+       * lib/m4sugar/m4sugar.m4 (m4_mkstemp): New macro.
+       (m4_maketemp): Avoid warnings with M4 1.9a.
+       * lib/emacs/autoconf-mode.el (autoconf-font-lock-keywords): Color
+       m4_mkstemp.
+       * doc/autoconf.texi (Redefined M4 Macros): Document m4_mkstemp.
+       * NEWS: Likewise.
+
 2006-10-16  Eric Blake  <ebb9@byu.net>
 
        * doc/autoconf.texi (Setting Output Variables): Fix typo.
diff --git a/NEWS b/NEWS
index c48eaf19fedadb493624ca264feb09f5f38854fa..030542319bf9288191bd8278dd9d4742669273cd 100644 (file)
--- a/NEWS
+++ b/NEWS
 
 ** GNU M4 1.4.7 or later is now recommended.
 
+** m4_mkstemp
+  New M4sugar macro, which is more secure than the POSIX M4 maketemp.
+
+** m4_maketemp
+  Now an alias for m4_mkstemp.
+
 * Major changes in Autoconf 2.60a (2006-08-25)
 
 ** GNU M4 1.4.6 or later is now recommended.  At least one "make check"
index 64f5908df9a3015c705a411f409c2dcf60e3bb63..1553fdb12269a59636a83db1f06fe4f938db5fbf 100644 (file)
@@ -9752,7 +9752,6 @@ M4sugar''.
 @msindex{index}
 @msindex{indir}
 @msindex{len}
-@msindex{maketemp}
 @msindex{pushdef}
 @msindex{shift}
 @msindex{substr}
@@ -9856,6 +9855,20 @@ m4_ifdef([@var{macro}], [m4_undefine([@var{macro}])])
 to recover the behavior of the builtin.
 @end defmac
 
+@defmac m4_maketemp (@var{template})
+@defmacx m4_mkstemp (@var{template})
+@msindex{maketemp}
+@msindex{mkstemp}
+Posix requires @code{maketemp} to replace the trailing @samp{X}
+characters in @var{template} with the process id, without regards to the
+existence of a file by that name, but this a security hole.  When this
+was pointed out to the Posix folks, they agreed to invent a new macro
+@code{mkstemp} that always creates a uniquely named file, but not all
+versions of @acronym{GNU} M4 support the new macro.  In M4sugar,
+@code{m4_maketemp} and @code{m4_mkstemp} are synonyms for each other,
+and both have the secure semantics regardless of which macro the
+underlying M4 provides.
+@end defmac
 
 
 @node Looping constructs
@@ -19135,4 +19148,6 @@ introduced in this document.
 @c Local Variables:
 @c fill-column: 72
 @c ispell-local-dictionary: "american"
+@c indent-tabs-mode: nil
+@c whitespace-check-buffer-indent: nil
 @c End:
index 3476765a65d2ce7871670584b9df532d63a932df..84eb03f5e5b540255ade571576a2ab4383192860 100644 (file)
@@ -6,7 +6,7 @@
 
 ;; This file is part of Autoconf
 
-;; Copyright 2001 Free Software Foundation, Inc.
+;; Copyright 2001, 2006 Free Software Foundation, Inc.
 ;;
 ;; This program is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
@@ -40,7 +40,7 @@
 (defvar autoconf-font-lock-keywords
   `(("\\bdnl \\(.*\\)"  1 font-lock-comment-face t)
     ("\\$[0-9*#@]" . font-lock-variable-name-face)
-    ("\\b\\(m4_\\)?\\(builtin\\|change\\(com\\|quote\\|word\\)\\|d\\(e\\(bug\\(file\\|mode\\)\\|cr\\|f\\(ine\\|n\\)\\)\\|iv\\(ert\\|num\\)\\|nl\\|umpdef\\)\\|e\\(rrprint\\|syscmd\\|val\\)\\|f\\(ile\\|ormat\\)\\|gnu\\|i\\(f\\(def\\|else\\)\\|n\\(c\\(lude\\|r\\)\\|d\\(ex\\|ir\\)\\)\\)\\|l\\(en\\|ine\\)\\|m\\(4\\(exit\\|wrap\\)\\|aketemp\\)\\|p\\(atsubst\\|opdef\\|ushdef\\)\\|regexp\\|s\\(hift\\|include\\|ubstr\\|ys\\(cmd\\|val\\)\\)\\|tra\\(ceo\\(ff\\|n\\)\\|nslit\\)\\|un\\(d\\(efine\\|ivert\\)\\|ix\\)\\)\\b" . font-lock-keyword-face)
+    ("\\b\\(m4_\\)?\\(builtin\\|change\\(com\\|quote\\|word\\)\\|d\\(e\\(bug\\(file\\|mode\\)\\|cr\\|f\\(ine\\|n\\)\\)\\|iv\\(ert\\|num\\)\\|nl\\|umpdef\\)\\|e\\(rrprint\\|syscmd\\|val\\)\\|f\\(ile\\|ormat\\)\\|gnu\\|i\\(f\\(def\\|else\\)\\|n\\(c\\(lude\\|r\\)\\|d\\(ex\\|ir\\)\\)\\)\\|l\\(en\\|ine\\)\\|m\\(4\\(exit\\|wrap\\)\\|aketemp\\|kstemp\\)\\|p\\(atsubst\\|opdef\\|ushdef\\)\\|regexp\\|s\\(hift\\|include\\|ubstr\\|ys\\(cmd\\|val\\)\\)\\|tra\\(ceo\\(ff\\|n\\)\\|nslit\\)\\|un\\(d\\(efine\\|ivert\\)\\|ix\\)\\)\\b" . font-lock-keyword-face)
     ("^\\(\\(m4_\\)?define\\|A._DEFUN\\|m4_defun\\)(\\[?\\([A-Za-z0-9_]+\\)" 3 font-lock-function-name-face)
     "default font-lock-keywords")
 )
index f9e7cd07b77486917f4ef96b71388b4012bda844..a4bfee4ea4b40dd0d4b975593d11196fd175659b 100644 (file)
@@ -140,7 +140,12 @@ m4_rename_m4([indir])
 m4_rename_m4([len])
 m4_rename([m4exit], [m4_exit])
 m4_rename([m4wrap], [m4_wrap])
-m4_rename_m4([maketemp])
+m4_ifdef([mkstemp],dnl added in M4 1.4.8
+[m4_rename_m4([mkstemp])
+m4_copy([m4_mkstemp], [m4_maketemp])
+m4_undefine([maketemp])],
+[m4_rename_m4([maketemp])
+m4_copy([m4_maketemp], [m4_mkstemp])])
 m4_rename([patsubst], [m4_bpatsubst])
 m4_undefine([popdef])
 m4_rename_m4([pushdef])