public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Test for secure_getenv too.
@ 2013-02-05  5:08 Cristian Rodríguez
  2013-02-06 11:04 ` Karel Zak
  0 siblings, 1 reply; 2+ messages in thread
From: Cristian Rodríguez @ 2013-02-05  5:08 UTC (permalink / raw)
  To: util-linux; +Cc: Cristian Rodríguez

In current glibc versions, internal __secure_getenv
no longer exists and was replaced by secure_getenv()

Signed-off-by: Cristian Rodríguez <crrodriguez@opensuse.org>
---
 configure.ac | 1 +
 lib/env.c    | 5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 9024809..39c7f20 100644
--- a/configure.ac
+++ b/configure.ac
@@ -298,6 +298,7 @@ AC_CHECK_DECL([strsignal],
 
 AC_CHECK_FUNCS([ \
 	__fpending \
+	secure_getenv \
 	__secure_getenv \
 	err \
 	errx \
diff --git a/lib/env.c b/lib/env.c
index 04e0f0b..9f81b44 100644
--- a/lib/env.c
+++ b/lib/env.c
@@ -100,8 +100,9 @@ char *safe_getenv(const char *arg)
 		return NULL;
 #endif
 #endif
-
-#ifdef HAVE___SECURE_GETENV
+#ifdef HAVE_SECURE_GETENV
+return secure_getenv(arg);
+#elif HAVE___SECURE_GETENV
 	return __secure_getenv(arg);
 #else
 	return getenv(arg);
-- 
1.8.1.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-02-06 11:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-05  5:08 [PATCH] Test for secure_getenv too Cristian Rodríguez
2013-02-06 11:04 ` Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox