(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-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.
** 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"
@msindex{index}
@msindex{indir}
@msindex{len}
-@msindex{maketemp}
@msindex{pushdef}
@msindex{shift}
@msindex{substr}
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
@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:
;; 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
(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")
)
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])