From a246b47b6730317cc3d21d0fa93f0465de7ec8dc Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 26 Jul 2000 15:44:58 +0000 Subject: [PATCH] * security.cc (lookup_name): Search on local machine first if myself->domain is not empty. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/security.cc | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 74187c329..fe3dcb592 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +Wed Jul 26 17:43:00 2000 Corinna Vinschen + + * security.cc (lookup_name): Search on local machine first if + myself->domain is not empty. + 2000-07-26 DJ Delorie * fhandler_console.cc (fhandler_console::read): Explicitly set cursor diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc index 42bf5f2bc..d640ac4a3 100644 --- a/winsup/cygwin/security.cc +++ b/winsup/cygwin/security.cc @@ -344,6 +344,23 @@ lookup_name (const char *name, const char *logsrv, PSID ret_sid) if (! name) return FALSE; + if (*myself->domain) + { + strcat (strcat (strcpy (domuser, myself->domain), "\\"), name); + if (LookupAccountName (NULL, domuser, + sid, (sidlen = MAX_SID_LEN, &sidlen), + dom, (domlen = MAX_COMPUTERNAME_LENGTH, &domlen), + &acc_type) + && legal_sid_type (acc_type)) + goto got_it; + if (logsrv && *logsrv + && LookupAccountName (logsrv, domuser, + sid, (sidlen = MAX_SID_LEN, &sidlen), + dom, (domlen = MAX_COMPUTERNAME_LENGTH,&domlen), + &acc_type) + && legal_sid_type (acc_type)) + goto got_it; + } if (logsrv && *logsrv) { if (LookupAccountName (logsrv, name,