aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-08-29 08:12:18 -0600
committerJason A. Donenfeld <Jason@zx2c4.com>2019-08-30 08:47:21 -0600
commite44c3c81d6d6337a1acc9700d7309f29a934d26e (patch)
treea77c2f7ee4ce3e0c5fd6a65179fbbe5fd342a012
parentwinipcfg: use upstream helper function for elevation test (diff)
downloadwireguard-windows-e44c3c81d6d6337a1acc9700d7309f29a934d26e.tar.xz
wireguard-windows-e44c3c81d6d6337a1acc9700d7309f29a934d26e.zip
elevate: ensure desktop token is opened with duplication allowed
-rw-r--r--elevate/membership.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/elevate/membership.go b/elevate/membership.go
index 0c090271..07c2ef69 100644
--- a/elevate/membership.go
+++ b/elevate/membership.go
@@ -52,7 +52,7 @@ func IsAdminDesktop() (bool, error) {
}
defer windows.CloseHandle(process)
var token windows.Token
- err = windows.OpenProcessToken(process, windows.TOKEN_QUERY|windows.TOKEN_IMPERSONATE, &token)
+ err = windows.OpenProcessToken(process, windows.TOKEN_QUERY|windows.TOKEN_DUPLICATE, &token)
if err != nil {
return false, err
}