]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
configure.ac, lib/gshadow.c: Presume working shadow group support in libc
authorAlejandro Colomar <alx@kernel.org>
Wed, 6 Nov 2024 12:07:29 +0000 (13:07 +0100)
committerAlejandro Colomar <alx@kernel.org>
Fri, 24 Jan 2025 11:10:15 +0000 (12:10 +0100)
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 <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
configure.ac
lib/gshadow.c

index 4e31d571209d340619b278c748915920c9501f56..5281fa4f4c8fb03d04d0f2284e647bc840431f2f 100644 (file)
@@ -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 <shadow.h>
-                               #ifdef HAVE_GSHADOW_H
-                               #include <gshadow.h>
-                               #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
index 072166f63e9616f9626b1b55106ed538ec33d7b1..4c1ddf25854c4a0ff65df3dbada4bfe9cfbf60d4 100644 (file)
@@ -9,8 +9,7 @@
 
 #include <config.h>
 
-/* 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