-
Notifications
You must be signed in to change notification settings - Fork 18k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
syscall: TOKEN_ALL_ACCESS inconsistency #25775
Comments
/cc @alexbrainman |
Yes current syscall.TOKEN_ALL_ACCESS is wrong. Current syscall.TOKEN_ALL_ACCESS was correct some long time ago, but was changed. We should change it. I am not sure if we are allowed to change syscall const value. Can we? This const is security related, so it makes it kind of important. Thank you. Alex |
We've decided that it's OK to change values in the syscall package if they are wrong (https://golang.org/doc/go1compat#operating_systems). Does golang.org/x/sys/windows also need to be fixed? |
I checked by writing tests
The result is
I see implementation in
It needs to add |
Change https://golang.org/cl/117635 mentions this issue: |
Indeed. Alex |
TOKEN_ALL_ACCESS was changed at some stage by Microsoft. Updates #25775 Change-Id: I3e18914207a0020b2ebfb99f4e57aa55f9de813b Reviewed-on: https://go-review.googlesource.com/117635 TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Change https://golang.org/cl/117815 mentions this issue: |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.10.2 windows/amd64
What operating system and processor architecture are you using (
go env
)?Windows 10
Windows SDK v7.0A
_WIN32_WINNT>0x400
What did you do?
I'm using Golang to rewrite a C++ Program in Windows
syscall.TOKEN_ALL_ACCESS in golang is 0xF00FF,
this value is the same as TOKEN_ALL_ACCESS_P in WinNT.h.
But TOKEN_ALL_ACCESS in WinNT.h is 0xF01FF (TOKEN_ALL_ACCESS_P|TOKEN_ADJUST_SESSIONID) when _WIN32_WINNT>0x400
The same name but different value, it is easily to make mistake.
What did you expect to see?
The value of syscall.TOKEN_ALL_ACCESS is the same as TOKEN_ALL_ACCESS in WinNT.h
What did you see instead?
syscall.TOKEN_ALL_ACCESS != TOKEN_ALL_ACCESS in WinNT.h
Thanks!
The text was updated successfully, but these errors were encountered: