summaryrefslogtreecommitdiff
path: root/m4/tempname.m4
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2013-08-04 09:56:56 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2013-08-04 09:56:56 -0700
commite0fdb6943066032db294720915c3bd644bf2bcd1 (patch)
tree0aa420b81dc0187e2efec3ff4fe3cf046ad1c598 /m4/tempname.m4
parent484ab23924d39b3e26d54074fd659633e1660ef4 (diff)
downloademacs-e0fdb6943066032db294720915c3bd644bf2bcd1.tar.gz
Fix some minor races in hosts lacking mkostemp.
Gnulib's emulation of mkostemp doesn't have races that Emacs's does. * configure.ac (mkostemp): Remove check for this function; gnulib does the check now. (mkstemp): Remove check for this no-longer-used function. * lib/mkostemp.c, lib/secure_getenv.c, lib/tempname.c, lib/tempname.h: * m4/mkostemp.m4, m4/secure_getenv.m4, m4/tempname.m4: New files, copied from Gnulib. * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate. * admin/merge-gnulib (GNULIB_MODULES): Add mkostemp. * lib-src/movemail.c (main): * lib-src/update-game-score.c (write_scores): Use mkostemp (which now works on all platforms, due to changes in the portability layer) rather than mktemp (which has a race) or mkstemp (which we no longer bother with). * src/callproc.c (create_temp_file): * src/filelock.c (create_lock_file): Assume mkostemp, since it's now provided by Gnulib. Fixes: debbugs:15015
Diffstat (limited to 'm4/tempname.m4')
-rw-r--r--m4/tempname.m419
1 files changed, 19 insertions, 0 deletions
diff --git a/m4/tempname.m4 b/m4/tempname.m4
new file mode 100644
index 00000000000..a6e42dcea81
--- /dev/null
+++ b/m4/tempname.m4
@@ -0,0 +1,19 @@
+#serial 5
+
+# Copyright (C) 2006-2007, 2009-2013 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# glibc provides __gen_tempname as a wrapper for mk[ds]temp. Expose
+# it as a public API, and provide it on systems that are lacking.
+AC_DEFUN([gl_FUNC_GEN_TEMPNAME],
+[
+ gl_PREREQ_TEMPNAME
+])
+
+# Prerequisites of lib/tempname.c.
+AC_DEFUN([gl_PREREQ_TEMPNAME],
+[
+ :
+])