tmpdir: use secure_getenv
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 5 Feb 2013 04:34:17 +0000 (20:34 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 5 Feb 2013 04:35:32 +0000 (20:35 -0800)
* 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.

ChangeLog
lib/tmpdir.c
m4/tmpdir.m4
modules/tmpdir

index 6639a18..4b046d3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2013-02-04  Paul Eggert  <eggert@cs.ucla.edu>
 
+       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.
index 6eb6d84..e804416 100644 (file)
 # 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.
  */
index 083c0bb..6dd5f70 100644 (file)
@@ -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], [:])
index 0dd1780..31fb104 100644 (file)
@@ -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
-