-
- Downloads
os/user: support calling Current on impersonated threads
The syscall.OpenCurrentProcessToken call in user.Current fails when called from an impersonated thread, as the process token is normally in that case. This change ensures that the current thread is not impersonated when calling OpenCurrentProcessToken, and then restores the impersonation state, if any. Fixes #68647 Change-Id: I3197535dd8355d21029a42f7aa3936d8fb021202 Reviewed-on: https://go-review.googlesource.com/c/go/+/602415 Reviewed-by:David Chase <drchase@google.com> Reviewed-by:
Michael Knyszek <mknyszek@google.com> Reviewed-by:
Alex Brainman <alex.brainman@gmail.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Showing
- src/internal/syscall/windows/security_windows.go 24 additions, 0 deletionssrc/internal/syscall/windows/security_windows.go
- src/internal/syscall/windows/syscall_windows.go 1 addition, 0 deletionssrc/internal/syscall/windows/syscall_windows.go
- src/internal/syscall/windows/zsyscall_windows.go 36 additions, 0 deletionssrc/internal/syscall/windows/zsyscall_windows.go
- src/os/user/lookup_windows.go 85 additions, 28 deletionssrc/os/user/lookup_windows.go
- src/os/user/user_windows_test.go 145 additions, 0 deletionssrc/os/user/user_windows_test.go
src/os/user/user_windows_test.go
0 → 100644
Please register or sign in to comment