aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/services
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-05-27 17:32:14 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-06-07 11:31:53 +0200
commit7b12ceede2b28ebe5dc22a50cb69fae1e97577a1 (patch)
tree9cb4a32a4ead2d32745b8df5787a11ed10c6cbc5 /services
parentui: confview: add more super horrible wm_sizing hacks (diff)
downloadwireguard-windows-7b12ceede2b28ebe5dc22a50cb69fae1e97577a1.tar.xz
wireguard-windows-7b12ceede2b28ebe5dc22a50cb69fae1e97577a1.zip
services: iterate through groups using helper
Diffstat (limited to 'services')
-rw-r--r--services/tokens.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/services/tokens.go b/services/tokens.go
index d3854f2d..ae89a185 100644
--- a/services/tokens.go
+++ b/services/tokens.go
@@ -18,9 +18,8 @@ func TokenIsMemberOfBuiltInAdministrator(token windows.Token) bool {
if err != nil {
return false
}
- groups := (*[(1 << 28) - 1]windows.SIDAndAttributes)(unsafe.Pointer(&gs.Groups[0]))[:gs.GroupCount]
isAdmin := false
- for _, g := range groups {
+ for _, g := range gs.AllGroups() {
if (g.Attributes&windows.SE_GROUP_USE_FOR_DENY_ONLY != 0 || g.Attributes&windows.SE_GROUP_ENABLED != 0) && g.Sid.IsWellKnown(windows.WinBuiltinAdministratorsSid) {
isAdmin = true
break