* security.cc (get_logon_server): Use strcasematch rather than strcasecmp.

This commit is contained in:
Christopher Faylor 2002-06-13 05:30:49 +00:00
parent 4863867ab9
commit 5f74ae83e5
2 changed files with 10 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2002-06-13 Christopher Faylor <cgf@redhat.com>
* security.cc (get_logon_server): Use strcasematch rather than
strcasecmp.
2002-06-12 Christopher Faylor <cgf@redhat.com> 2002-06-12 Christopher Faylor <cgf@redhat.com>
* path.cc (chdir): Minor cleanup. * path.cc (chdir): Minor cleanup.

View File

@ -256,15 +256,15 @@ get_lsa_srv_inf (LSA_HANDLE lsa, char *logonserver, char *domain)
#endif #endif
BOOL BOOL
get_logon_server (const char * domain, char * server, WCHAR *wserver) get_logon_server (const char *domain, char *server, WCHAR *wserver)
{ {
WCHAR wdomain[INTERNET_MAX_HOST_NAME_LENGTH + 1]; WCHAR wdomain[INTERNET_MAX_HOST_NAME_LENGTH + 1];
NET_API_STATUS ret; NET_API_STATUS ret;
WCHAR * buf; WCHAR * buf;
DWORD size = INTERNET_MAX_HOST_NAME_LENGTH + 1; DWORD size = INTERNET_MAX_HOST_NAME_LENGTH + 1;
if ((GetComputerNameA(server + 2, &size)) && if ((GetComputerName (server + 2, &size)) &&
!strcasecmp(domain, server + 2)) strcasematch (domain, server + 2))
{ {
server[0] = server[1] = '\\'; server[0] = server[1] = '\\';
if (wserver) if (wserver)
@ -274,7 +274,7 @@ get_logon_server (const char * domain, char * server, WCHAR *wserver)
/* Try to get the primary domain controller for the domain */ /* Try to get the primary domain controller for the domain */
sys_mbstowcs (wdomain, domain, INTERNET_MAX_HOST_NAME_LENGTH + 1); sys_mbstowcs (wdomain, domain, INTERNET_MAX_HOST_NAME_LENGTH + 1);
if ((ret = NetGetDCName(NULL, wdomain, (LPBYTE *) &buf)) == STATUS_SUCCESS) if ((ret = NetGetDCName (NULL, wdomain, (LPBYTE *) &buf)) == STATUS_SUCCESS)
{ {
sys_wcstombs (server, buf, INTERNET_MAX_HOST_NAME_LENGTH + 1); sys_wcstombs (server, buf, INTERNET_MAX_HOST_NAME_LENGTH + 1);
if (wserver) if (wserver)
@ -511,7 +511,7 @@ get_group_sidlist (cygsidlist &grp_list,
} }
else else
{ {
if (!get_logon_server( domain, server, wserver)) if (!get_logon_server (domain, server, wserver))
return FALSE; return FALSE;
if (my_grps) if (my_grps)
{ {