]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
Try to use secure_getenv() in preference to __secure_getenv()
authorTheodore Ts'o <tytso@mit.edu>
Sun, 16 Jun 2013 18:34:59 +0000 (14:34 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 16 Jun 2013 18:34:59 +0000 (14:34 -0400)
If secure_getenv() use it in preference to __secure_getenv().
Starting with (e)glibc version 2.17, secure_getenv() exists, while
__secure_getenv() only works with shared library links (where it is a
weak symbol), but not for static links with /lib/libc.a

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
configure
configure.in
lib/blkid/cache.c
lib/config.h.in
lib/et/error_message.c
lib/ext2fs/test_io.c
lib/ss/pager.c

index c91e6059103870ebad776a0921bec41b5a34f20c..fdbb3e983ff14769e74e1d7b97c35108428bd4e1 100755 (executable)
--- a/configure
+++ b/configure
@@ -11010,7 +11010,7 @@ if test "$ac_res" != no; then :
 fi
 
 fi
-for ac_func in         __secure_getenv         backtrace       blkid_probe_get_topology        chflags         fallocate       fallocate64     fchown  fdatasync       fstat64         ftruncate64     getdtablesize   getmntinfo      getpwuid_r      getrlimit       getrusage       jrand48         llseek  lseek64         mallinfo        mbstowcs        memalign        mmap    msync   nanosleep       open64  pathconf        posix_fadvise   posix_memalign  prctl   setmntent       setresgid       setresuid       srandom         strcasecmp      strdup  strnlen         strptime        strtoull        sync_file_range         sysconf         usleep  utime   valloc
+for ac_func in         __secure_getenv         backtrace       blkid_probe_get_topology        chflags         fallocate       fallocate64     fchown  fdatasync       fstat64         ftruncate64     getdtablesize   getmntinfo      getpwuid_r      getrlimit       getrusage       jrand48         llseek  lseek64         mallinfo        mbstowcs        memalign        mmap    msync   nanosleep       open64  pathconf        posix_fadvise   posix_memalign  prctl   secure_getenv   setmntent       setresgid       setresuid       srandom         strcasecmp      strdup  strnlen         strptime        strtoull        sync_file_range         sysconf         usleep  utime   valloc
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
index c3687bb84dac9595d8f729c7c630565627f5e106..5ca968f30a3a02279241df4b18fae6f92c646aaa 100644 (file)
@@ -1025,6 +1025,7 @@ AC_CHECK_FUNCS(m4_flatten([
        posix_fadvise
        posix_memalign
        prctl
+       secure_getenv
        setmntent
        setresgid
        setresuid
index 73900a5101f55130ac1ed7968b1c3b304ece4136..8bdd239916c2a6884c0d48b29161d0cdeed495fe 100644 (file)
@@ -11,6 +11,9 @@
  */
 
 #include "config.h"
+#if HAVE_SECURE_GETENV
+#define _GNU_SOURCE
+#endif
 #if HAVE_UNISTD_H
 #include <unistd.h>
 #endif
@@ -49,7 +52,9 @@ static char *safe_getenv(const char *arg)
 #endif
 #endif
 
-#ifdef HAVE___SECURE_GETENV
+#if defined(HAVE_SECURE_GETENV)
+       return secure_getenv(arg);
+#elif defined(HAVE___SECURE_GETENV)
        return __secure_getenv(arg);
 #else
        return getenv(arg);
index e14eff4f115ff4ee4b37a89bc2325ab56534151f..0c7d8544213a4b5e1da2254ab753e5ef65b70f69 100644 (file)
 /* Define to 1 if if struct sockaddr contains sa_len */
 #undef HAVE_SA_LEN
 
+/* Define to 1 if you have the `secure_getenv' function. */
+#undef HAVE_SECURE_GETENV
+
 /* Define to 1 if you have the <semaphore.h> header file. */
 #undef HAVE_SEMAPHORE_H
 
index dc77b69fbf57ae28545011d1eb47457c70287230..92509e63abc2459668f5b85684ec036a356854ff 100644 (file)
@@ -17,6 +17,9 @@
  */
 
 #include "config.h"
+#if HAVE_SECURE_GETENV
+#define _GNU_SOURCE
+#endif
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -209,7 +212,9 @@ static char *safe_getenv(const char *arg)
 #endif
 #endif
 
-#ifdef HAVE___SECURE_GETENV
+#if defined(HAVE_SECURE_GETENV)
+       return secure_getenv(arg);
+#elif defined(HAVE___SECURE_GETENV)
        return __secure_getenv(arg);
 #else
        return getenv(arg);
index 7d3cdfed9b1124a8557eba333816be6ded62987c..cac67219b81be214c692e541e4503b6b1f518285 100644 (file)
  */
 
 #include "config.h"
+#if HAVE_SECURE_GETENV
+#define _GNU_SOURCE
+#endif
+#if HAVE_SECURE_GETENV
+#define _GNU_SOURCE
+#endif
 #include <stdio.h>
 #include <string.h>
 #if HAVE_UNISTD_H
@@ -173,7 +179,9 @@ static char *safe_getenv(const char *arg)
 #endif
 #endif
 
-#ifdef HAVE___SECURE_GETENV
+#if defined(HAVE_SECURE_GETENV)
+       return secure_getenv(arg);
+#elif defined(HAVE___SECURE_GETENV)
        return __secure_getenv(arg);
 #else
        return getenv(arg);
index 2b3a466530e04639916e18e8e599fdd2b3a08381..8b54dd1ab97ae4bf28f466f5f42781e0d0611c26 100644 (file)
@@ -15,6 +15,9 @@
  */
 
 #include "config.h"
+#if HAVE_SECURE_GETENV
+#define _GNU_SOURCE
+#endif
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
@@ -56,7 +59,9 @@ char *ss_safe_getenv(const char *arg)
 #endif
 #endif
 
-#ifdef HAVE___SECURE_GETENV
+#if defined(HAVE_SECURE_GETENV)
+       return secure_getenv(arg);
+#elif defined(HAVE___SECURE_GETENV)
        return __secure_getenv(arg);
 #else
        return getenv(arg);