Cygwin: get_user_groups: fetch a user's group list from identification token

NetUserGetGroups and NetUserGetLocalGroups sometimes take a lot of time
(up to more than 2 mins) for no apparent reason.

Call s4uauth to generate an identification token for the user and fetch
the group list from there.  This is *much* faster.

Keep the old code only for the sake of WOW64 on Vista and Windows 7,
which don't implement MsV1_0S4ULogon.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen
2019-02-22 18:31:03 +01:00
parent 105fbdebdd
commit 649911fb40
3 changed files with 66 additions and 27 deletions

View File

@@ -33,6 +33,7 @@ struct wincaps
unsigned has_posix_unlink_semantics : 1;
unsigned has_case_sensitive_dirs : 1;
unsigned has_posix_rename_semantics : 1;
unsigned no_msv1_0_s4u_logon_in_wow64 : 1;
};
};
@@ -87,6 +88,7 @@ public:
bool IMPLEMENT (has_posix_unlink_semantics)
bool IMPLEMENT (has_case_sensitive_dirs)
bool IMPLEMENT (has_posix_rename_semantics)
bool IMPLEMENT (no_msv1_0_s4u_logon_in_wow64)
void disable_case_sensitive_dirs ()
{