
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
25 lines
792 B
Text
25 lines
792 B
Text
# Look up an environment variable more securely.
|
|
dnl Copyright 2013 Free Software Foundation, Inc.
|
|
dnl This file is free software; the Free Software Foundation
|
|
dnl gives unlimited permission to copy and/or distribute it,
|
|
dnl with or without modifications, as long as this notice is preserved.
|
|
|
|
AC_DEFUN([gl_FUNC_SECURE_GETENV],
|
|
[
|
|
dnl Persuade glibc <stdlib.h> to declare secure_getenv().
|
|
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
|
|
|
|
AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
|
|
AC_CHECK_FUNCS_ONCE([secure_getenv])
|
|
if test $ac_cv_func_secure_getenv = no; then
|
|
HAVE_SECURE_GETENV=0
|
|
fi
|
|
])
|
|
|
|
# Prerequisites of lib/secure_getenv.c.
|
|
AC_DEFUN([gl_PREREQ_SECURE_GETENV], [
|
|
AC_CHECK_FUNCS([__secure_getenv])
|
|
if test $ac_cv_func___secure_getenv = no; then
|
|
AC_CHECK_FUNCS([issetugid])
|
|
fi
|
|
])
|