4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-02-21 00:07:36 +08:00

Cygwin: getgrent/getpwent: avoid local enumeration on DCs

...if we're supposed to enumerate the AD accounts anyway.  This
avoids some useless duplication.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2024-02-20 23:54:25 +01:00
parent 15e82eef3a
commit c90b20192d

View 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;