From: Alejandro Colomar Date: Wed, 6 Nov 2024 12:07:29 +0000 (+0100) Subject: configure.ac, lib/gshadow.c: Presume working shadow group support in libc X-Git-Tag: 4.17.3~54 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da6b9cff02d583ef169a0bc0c1014b19b5fad2fb;p=thirdparty%2Fshadow.git configure.ac, lib/gshadow.c: Presume working shadow group support in libc This check was testing a specific bug in a prehistoric libc version. Red Hat 3 is long dead, and it doesn't make sense to test for that specific bug. Reviewed-by: Serge Hallyn Signed-off-by: Alejandro Colomar --- diff --git a/configure.ac b/configure.ac index 4e31d5712..5281fa4f4 100644 --- a/configure.ac +++ b/configure.ac @@ -76,33 +76,6 @@ 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, - ac_cv_libc_shadowgrp, - AC_RUN_IFELSE([AC_LANG_SOURCE([ - #include - #ifdef HAVE_GSHADOW_H - #include - #endif - int - main() - { - struct sgrp *sg = sgetsgent("test:x::"); - /* NYS libc on Red Hat 3.0.3 has broken shadow group support */ - return !sg || !sg->sg_adm || !sg->sg_mem; - }] - )], - [ac_cv_libc_shadowgrp=yes], - [ac_cv_libc_shadowgrp=no], - [ac_cv_libc_shadowgrp=no] - ) - ) - - if test "$ac_cv_libc_shadowgrp" = "yes"; then - AC_DEFINE(HAVE_SHADOWGRP, 1, [Have working shadow group support in libc]) - fi -fi - 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 if test -d $shadow_cv_maildir; then diff --git a/lib/gshadow.c b/lib/gshadow.c index 072166f63..4c1ddf258 100644 --- a/lib/gshadow.c +++ b/lib/gshadow.c @@ -9,8 +9,7 @@ #include -/* Newer versions of Linux libc already have shadow support. */ -#if defined(SHADOWGRP) && !defined(HAVE_SHADOWGRP) /*{ */ +#if defined(SHADOWGRP) && !defined(HAVE_GSHADOW_H) #ident "$Id$" @@ -276,4 +275,4 @@ int putsgent (const struct sgrp *sgrp, FILE * fp) } #else extern int ISO_C_forbids_an_empty_translation_unit; -#endif /*} SHADOWGRP */ +#endif // !SHADOWGRP