]> sourceware.org Git - newlib-cygwin.git/commitdiff
Cygwin: getgrent/getpwent: avoid local enumeration on DCs
authorCorinna Vinschen <corinna@vinschen.de>
Tue, 20 Feb 2024 22:54:25 +0000 (23:54 +0100)
committerCorinna Vinschen <corinna@vinschen.de>
Tue, 20 Feb 2024 22:55:51 +0000 (23:55 +0100)
...if we're supposed to enumerate the AD accounts anyway.  This
avoids some useless duplication.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
winsup/cygwin/passwd.cc

index 0be8aa6b8b0e0865f2aaf81bdeb731f5c628c458..b8457a46f963b549279b4507e919628a32b48e79 100644 (file)
@@ -385,6 +385,11 @@ pg_ent::getent (void)
     case from_local:
       if (from_db
          && nss_db_enum_local ()
+         /* Domain controller?  If so, sam and ad are one and the same
+            and "local ad" would list all domain accounts twice without
+            this test. */
+         && (cygheap->dom.account_flat_name ()[0] != L'@'
+             || !nss_db_enum_primary ())
          && (entry = enumerate_local ()))
        return entry;
       state = from_sam;
This page took 0.030657 seconds and 5 git commands to generate.