From 2e8abfc1c50f541002610c4473caefee64183f04 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 6 Jun 2002 11:17:51 +0000 Subject: * sec_helper.cc (lookup_name): Suppress. * security.cc (alloc_sd): Remove logsrv argument. Remove two calls to lookup_name. (set_security_attribute): Remove logsrv argument. Remove logsrv argument in call to alloc_sd. (set_nt_attribute): Remove logsrv argument. Remove logsrv argument in call to set_security_attribute. (set_file_attribute): Remove logsrv argument. Remove logsrv argument in call to set_nt_attribute. (set_file_attribute): Remove logsrv argument. Remove logsrv argument in call to set_file_attribute. * syscalls.cc (chown_worker): Remove logserver argument in call to set_file_attribute. (chmod): Ditto. * shm.cc (shmget): Remove logsrv argument in call to alloc_sd. * uinfo.cc (internal_getlogin): Replace calls to lookup_name by call to LookupAccountName. * security.h: Remove logsrv in declarations of set_file_attribute and alloc_sd. Remove declaration of lookup_name. --- winsup/cygwin/uinfo.cc | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'winsup/cygwin/uinfo.cc') diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc index e41a1cbe8..20171c497 100644 --- a/winsup/cygwin/uinfo.cc +++ b/winsup/cygwin/uinfo.cc @@ -150,17 +150,19 @@ internal_getlogin (cygheap_user &user) and a domain user may have the same name. */ if (!ret && user.domain ()) { + char domain[DNLEN + 1]; + DWORD dlen = sizeof (domain); + siz = sizeof (tu); + SID_NAME_USE use = SidTypeInvalid; /* Concat DOMAIN\USERNAME for the next lookup */ strcat (strcat (strcpy (buf, user.domain ()), "\\"), user.name ()); - if (!(ret = lookup_name (buf, NULL, user.sid ()))) - debug_printf ("Couldn't retrieve SID locally!"); - } + if (!LookupAccountName (NULL, buf, tu, &siz, + domain, &dlen, &use) || + !legal_sid_type (use)) + debug_printf ("Couldn't retrieve SID locally!"); + else user.set_sid (tu); - /* If that fails, too, as a last resort try to get the SID from - the logon server. */ - if (!ret && !(ret = lookup_name (user.name (), user.logsrv (), - user.sid ()))) - debug_printf ("Couldn't retrieve SID from '%s'!", user.logsrv ()); + } /* If we have a SID, try to get the corresponding Cygwin user name which can be different from the Windows user name. */ -- cgit v1.2.3