vc60er/winsvc

Runtime error when interactive user is in too many groups (?)

Closed this issue · 3 comments

Hi, probably not a common occurrence, but when I use the 
svc.IsAnInteractiveSession as a user in a lot of groups it panics due to the 
size of the syscall.SIDAndAttributes array (svc/security.go:84).

I'm not much of a programmer and i'm even newer with golang so I'm not sure if 
this length can somehow be defined at runtime.  I can fix it by increasing it 
to an arbitary value > gs.GroupCount but obviously this will just fix it for a 
set number of groups returned on the token.

What steps will reproduce the problem?
1. Run code from example folder as a user in a large number of groups 
(gs.GroupCount > 256)

What version of the product are you using? On what operating system?
Windows 7 64 bit, golang 1.3.3 or 1.4.2

Please provide any additional information below.
Trace attached


Original issue reported on code.google.com by j...@jmn.id.au on 1 Apr 2015 at 3:56

Attachments:

It was unreasonable of me to assume groups are so small. I propose we change 
max group size to much larger value - this should be large enough for everyone. 
Here https://codereview.appspot.com/217650043/ my proposed change. Please 
review it. Thank you.

Alex

Original comment by alex.bra...@gmail.com on 1 Apr 2015 at 11:10

  • Changed state: Started
That will definitely fix it for me!  For reference, I was getting a 
gs.GroupCount of 317, if anyone gets near 2 << 20 I would be highly surprised.

Thank you!

Original comment by j...@jmn.id.au on 1 Apr 2015 at 11:34

This issue was closed by revision 338ee825126c.

Original comment by alex.bra...@gmail.com on 1 Apr 2015 at 11:37

  • Changed state: Fixed