This is the mail archive of the cygwin-apps 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]

Re: setup-1.7 defaults to "Just me"

Corinna Vinschen wrote:

> I just found that, regardless of my privileges, setup-1.7 defaults
> to install for "just me" instead of "all users" while the standard
> setup defaults to "all users".  Why does that happen?

This is very odd.  Setup's is_admin() was returning 0 despite the user
belonging to the administrators group, and debugging revealed that the
cause was the following:

 // Get the group token information
 UCHAR token_info[1024];
 PTOKEN_GROUPS groups = (PTOKEN_GROUPS) token_info;
 DWORD token_info_len = sizeof (token_info);
 status =
   GetTokenInformation (token, TokenGroups, token_info, token_info_len,
 CloseHandle (token);
 if (!status)
   return 0;

For whatever reason, GetTokenInformation was failing and returning
ERROR_NOACCESS when passed a 1024 byte buffer.  I changed the code to
first call it with NULL to get the desired size, and that seems to have
satisfied it.  I cannot explain why it would object to a 1024 byte
buffer, maybe you have some idea.

I'll install an updated setup-1.7.exe in a moment.


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