diff --git a/README b/README index 952ac578..26cfff1e 100644 --- a/README +++ b/README @@ -51,6 +51,7 @@ Brian R. Gaeke Calle Karlsson Chip Rosenthal Chris Evans +Chris Lamb Cristian Gafton Dan Walsh Darcy Boese diff --git a/configure.ac b/configure.ac index da236722..a738ad66 100644 --- a/configure.ac +++ b/configure.ac @@ -110,6 +110,9 @@ AC_REPLACE_FUNCS(sgetgrent sgetpwent sgetspent) AC_REPLACE_FUNCS(snprintf strcasecmp strdup strerror strstr) AC_CHECK_FUNC(setpgrp) +AC_CHECK_FUNC(secure_getenv, [AC_DEFINE(HAS_SECURE_GETENV, + 1, + [Defined to 1 if you have the declaration of 'secure_getenv'])]) if test "$ac_cv_header_shadow_h" = "yes"; then AC_CACHE_CHECK(for working shadow group support, diff --git a/lib/defines.h b/lib/defines.h index cded1417..2fb1b56e 100644 --- a/lib/defines.h +++ b/lib/defines.h @@ -382,4 +382,10 @@ extern char *strerror (); # endif #endif +#ifdef HAVE_SECURE_GETENV +# define shadow_getenv(name) secure_getenv(name) +# else +# define shadow_getenv(name) getenv(name) +#endif + #endif /* _DEFINES_H_ */ diff --git a/libmisc/gettime.c b/libmisc/gettime.c index 53eaf516..0e25a4b7 100644 --- a/libmisc/gettime.c +++ b/libmisc/gettime.c @@ -52,7 +52,7 @@ unsigned long long epoch; fallback = time (NULL); - source_date_epoch = getenv ("SOURCE_DATE_EPOCH"); + source_date_epoch = shadow_getenv ("SOURCE_DATE_EPOCH"); if (!source_date_epoch) return fallback;