* security.cc (lsa2str): New function.
(get_priv_list): Call lsa2str instead of sys_wcstombs.
This commit is contained in:
parent
75bf293153
commit
74b2f73ea4
winsup/cygwin
|
@ -1,3 +1,8 @@
|
||||||
|
2002-05-24 Pierre Humblet <pierre.humblet@ieee.org>
|
||||||
|
|
||||||
|
* security.cc (lsa2str): New function.
|
||||||
|
(get_priv_list): Call lsa2str instead of sys_wcstombs.
|
||||||
|
|
||||||
2002-05-22 Pierre Humblet <pierre.humblet@ieee.org>
|
2002-05-22 Pierre Humblet <pierre.humblet@ieee.org>
|
||||||
|
|
||||||
* syscalls.cc (seteuid): Do not take allow_ntsec into account.
|
* syscalls.cc (seteuid): Do not take allow_ntsec into account.
|
||||||
|
|
|
@ -174,6 +174,15 @@ lsa2wchar (WCHAR *tgt, LSA_UNICODE_STRING &src, int size)
|
||||||
tgt[size] = 0;
|
tgt[size] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
lsa2str (char *tgt, LSA_UNICODE_STRING &src, int size)
|
||||||
|
{
|
||||||
|
if (src.Length / 2 < size)
|
||||||
|
size = src.Length / 2;
|
||||||
|
sys_wcstombs (tgt, src.Buffer, size);
|
||||||
|
tgt[size] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
static LSA_HANDLE
|
static LSA_HANDLE
|
||||||
open_local_policy ()
|
open_local_policy ()
|
||||||
{
|
{
|
||||||
|
@ -629,8 +638,7 @@ get_priv_list (LSA_HANDLE lsa, cygsid &usersid, cygsidlist &grp_list)
|
||||||
PTOKEN_PRIVILEGES tmp;
|
PTOKEN_PRIVILEGES tmp;
|
||||||
DWORD tmp_count;
|
DWORD tmp_count;
|
||||||
|
|
||||||
sys_wcstombs (buf, privstrs[i].Buffer,
|
lsa2str (buf, privstrs[i], sizeof(buf) - 1);
|
||||||
INTERNET_MAX_HOST_NAME_LENGTH + 1);
|
|
||||||
if (!LookupPrivilegeValue (NULL, buf, &priv))
|
if (!LookupPrivilegeValue (NULL, buf, &priv))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue