From: Paul Eggert Date: Tue, 5 Feb 2013 04:34:17 +0000 (-0800) Subject: tmpdir: use secure_getenv X-Git-Tag: v0.1~214 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=4f8db5e209fa87dbe3954b27b1bdeb53a28d61ee;p=gnulib.git tmpdir: use secure_getenv * lib/tmpdir.c (__secure_getenv) [!LIBC]: Define to secure_getenv, not getenv. * m4/tmpdir.m4 (gt_TMPDIR): Don't check for __secure_getenv, as that's now secure_getenv's job. * modules/tmpdir (Depends-on): Add secure_getenv. --- diff --git a/ChangeLog b/ChangeLog index 6639a186d9..4b046d3b96 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2013-02-04 Paul Eggert + tmpdir: use secure_getenv + * lib/tmpdir.c (__secure_getenv) [!LIBC]: + Define to secure_getenv, not getenv. + * m4/tmpdir.m4 (gt_TMPDIR): Don't check for __secure_getenv, + as that's now secure_getenv's job. + * modules/tmpdir (Depends-on): Add secure_getenv. + tempname: use secure_getenv * lib/tempname.c (__secure_getenv) [!_LIBC]: Define to secure_getenv, not getenv. diff --git a/lib/tmpdir.c b/lib/tmpdir.c index 6eb6d84b1f..e8044162c0 100644 --- a/lib/tmpdir.c +++ b/lib/tmpdir.c @@ -53,13 +53,10 @@ # define struct_stat64 struct stat64 #else # define struct_stat64 struct stat +# define __secure_getenv secure_getenv # define __xstat64(version, path, buf) stat (path, buf) #endif -#if ! (HAVE___SECURE_GETENV || _LIBC) -# define __secure_getenv getenv -#endif - /* Pathname support. ISSLASH(C) tests whether C is a directory separator character. */ diff --git a/m4/tmpdir.m4 b/m4/tmpdir.m4 index 083c0bbf48..6dd5f70994 100644 --- a/m4/tmpdir.m4 +++ b/m4/tmpdir.m4 @@ -1,4 +1,4 @@ -# tmpdir.m4 serial 3 +# tmpdir.m4 serial 4 dnl Copyright (C) 2001-2002, 2006, 2009-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, @@ -6,7 +6,4 @@ dnl with or without modifications, as long as this notice is preserved. # Prerequisites for lib/tmpdir.c -AC_DEFUN([gt_TMPDIR], -[ - AC_CHECK_FUNCS([__secure_getenv]) -]) +AC_DEFUN([gt_TMPDIR], [:]) diff --git a/modules/tmpdir b/modules/tmpdir index 0dd1780fda..31fb104f3f 100644 --- a/modules/tmpdir +++ b/modules/tmpdir @@ -7,6 +7,7 @@ lib/tmpdir.c m4/tmpdir.m4 Depends-on: +secure_getenv stdbool sys_stat pathmax @@ -25,4 +26,3 @@ LGPL Maintainer: Bruno Haible -