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"

On Apr 15 21:55, Brian Dessent wrote:
> 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,
> 			 &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.

Not really, no.  1024 bytes should be big enough in most cases.  Did you
look for the desired size which now gets returned by the NULL call?

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


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

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