diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2002-07-02 09:02:53 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2002-07-02 09:02:53 +0000 |
commit | 891bb974f91e19c1126cb5c0b52ee429dd1e14ef (patch) | |
tree | 524a275cdf2c0073fd7755e7d0fef54aa5dbe547 | |
parent | aeed87e86e2e724607e1d45804402374bf1a5fcc (diff) | |
download | newlib-891bb974f91e19c1126cb5c0b52ee429dd1e14ef.zip newlib-891bb974f91e19c1126cb5c0b52ee429dd1e14ef.tar.gz newlib-891bb974f91e19c1126cb5c0b52ee429dd1e14ef.tar.bz2 |
* security.cc (get_logon_server): Interpret a zero length
domain as the local domain.
(get_group_sidlist): Add authenticated users SID to SYSTEM's group
list instead of SYSTEM itself.
(verify_token): Accept the primary group sid if it equals
the token user sid.
-rw-r--r-- | winsup/cygwin/ChangeLog | 9 | ||||
-rw-r--r-- | winsup/cygwin/security.cc | 9 |
2 files changed, 15 insertions, 3 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index aa83b1e..0f95029 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,12 @@ +2002-07-01 Pierre Humblet <pierre.humblet@ieee.org> + + * security.cc (get_logon_server): Interpret a zero length + domain as the local domain. + (get_group_sidlist): Add authenticated users SID to SYSTEM's group + list instead of SYSTEM itself. + (verify_token): Accept the primary group sid if it equals + the token user sid. + 2002-07-02 Corinna Vinschen <corinna@vinschen.de> * cygwin.din (__fpclassifyd): Add symbol. diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc index 6c239af..0bf37a4 100644 --- a/winsup/cygwin/security.cc +++ b/winsup/cygwin/security.cc @@ -255,8 +255,9 @@ get_logon_server (const char *domain, char *server, WCHAR *wserver) WCHAR * buf; DWORD size = INTERNET_MAX_HOST_NAME_LENGTH + 1; + /* Empty domain is interpreted as local system */ if ((GetComputerName (server + 2, &size)) && - strcasematch (domain, server + 2)) + (strcasematch (domain, server + 2) || !domain[0])) { server[0] = server[1] = '\\'; if (wserver) @@ -489,7 +490,7 @@ get_group_sidlist (cygsidlist &grp_list, grp_list += well_known_world_sid; if (usersid == well_known_system_sid) { - grp_list += well_known_system_sid; + grp_list += well_known_authenticated_users_sid; grp_list += well_known_admins_sid; } else @@ -699,10 +700,12 @@ verify_token (HANDLE token, cygsid &usersid, cygsid &pgrpsid, BOOL * pintern) debug_printf ("GetSecurityDescriptorGroup(): %E"); if (well_known_null_sid != gsid) return pgrpsid == gsid; } - /* See if the pgrpsid is in the token groups */ + /* See if the pgrpsid is the tok_usersid in the token groups */ PTOKEN_GROUPS my_grps = NULL; BOOL ret = FALSE; + if ( pgrpsid == tok_usersid) + return TRUE; if (!GetTokenInformation (token, TokenGroups, NULL, 0, &size) && GetLastError () != ERROR_INSUFFICIENT_BUFFER) debug_printf ("GetTokenInformation(token, TokenGroups): %E\n"); |