bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 3/3] tmpdir: use secure_getenv


From: Paul Eggert
Subject: [PATCH 3/3] tmpdir: use secure_getenv
Date: Tue, 05 Feb 2013 00:05:20 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2

* 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      | 7 +++++++
 lib/tmpdir.c   | 5 +----
 m4/tmpdir.m4   | 7 ++-----
 modules/tmpdir | 2 +-
 4 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6639a18..4b046d3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2013-02-04  Paul Eggert  <address@hidden>
 
+       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 6eb6d84..e804416 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 083c0bb..6dd5f70 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 0dd1780..31fb104 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
-
-- 
1.7.11.7





reply via email to

[Prev in Thread] Current Thread [Next in Thread]