]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
configure.ac: fix detection of secure_getenv
authorMike Gilbert <floppym@gentoo.org>
Mon, 16 Feb 2026 20:36:37 +0000 (15:36 -0500)
committerAlejandro Colomar <foss+github@alejandro-colomar.es>
Tue, 17 Feb 2026 01:26:24 +0000 (02:26 +0100)
lib/defines.h was looking for HAVE_SECURE_GETENV instead of of
HAS_SECURE_GETENV as defined in configure. This resulted in
shadow_getenv always being defined to getenv.

AC_CHECK_FUNC is linker test; it does not check for declarations.
Replace this with AC_CHECK_DECLS/HAVE_DECL_SECURE_GETENV.

Fixes: 3d921155e0a7 (2019-03-31; "gettime: Use secure_getenv over getenv.")
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
configure.ac
lib/defines.h

index a5030b028cd671b0aa705f8e8a8a882bd571ae33..5341d36bf66ff4aff7bea3185c2e5995778af7c5 100644 (file)
@@ -68,9 +68,7 @@ AC_REPLACE_FUNCS([putgrent putpwent putspent])
 AC_REPLACE_FUNCS([sgetgrent sgetpwent sgetspent])
 
 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'])]
-)
+AC_CHECK_DECLS([secure_getenv])
 
 AC_CACHE_CHECK([location of shared mail directory], [shadow_cv_maildir],
 [for shadow_cv_maildir in /var/mail /var/spool/mail /usr/spool/mail /usr/mail none; do
index 09c0965a02b4c0decc429e65b7fee561f2e4ea24..3277dfeb3ba7153e31ef23c72463934c0f54ba55 100644 (file)
 /* Maximum length of passwd entry */
 #define PASSWD_ENTRY_MAX_LENGTH 32768
 
-#ifdef HAVE_SECURE_GETENV
+#if HAVE_DECL_SECURE_GETENV
 #  define shadow_getenv(name) secure_getenv(name)
 # else
 #  define shadow_getenv(name) getenv(name)