This is the mail archive of the cygwin-cvs@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[newlib-cygwin] Use 64K buffers for TOKEN_GROUPS


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=fc504453fd98a03c81d796cff179ebf6262d107c

commit fc504453fd98a03c81d796cff179ebf6262d107c
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Wed Mar 23 17:42:04 2016 +0100

    Use 64K buffers for TOKEN_GROUPS
    
    A user token can be up to 64K in size.  Using 32K buffers for TOKEN_GROUPS
    may be insufficient.
    
    	* uinfo.cc (get_logon_sid): Use 64K buffers for the TOKEN_GROUPS
    	array.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/uinfo.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc
index 9596f8f..86b0101 100644
--- a/winsup/cygwin/uinfo.cc
+++ b/winsup/cygwin/uinfo.cc
@@ -1462,12 +1462,12 @@ get_logon_sid ()
       NTSTATUS status;
       ULONG size;
       tmp_pathbuf tp;
-      PTOKEN_GROUPS groups = (PTOKEN_GROUPS) tp.c_get ();
+      PTOKEN_GROUPS groups = (PTOKEN_GROUPS) tp.w_get ();
 
       status = NtQueryInformationToken (hProcToken, TokenGroups, groups,
-					NT_MAX_PATH, &size);
+					2 * NT_MAX_PATH, &size);
       if (!NT_SUCCESS (status))
-	debug_printf ("NtQueryInformationToken() %y", status);
+	debug_printf ("NtQueryInformationToken (TokenGroups) %y", status);
       else
 	{
 	  for (DWORD pg = 0; pg < groups->GroupCount; ++pg)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]