Skip to content
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

Bug: incorrectly calculating length of security descriptor in SddlToSecurityDescriptor #298

Closed
dblohm7 opened this issue Aug 9, 2023 · 0 comments

Comments

@dblohm7
Copy link
Contributor

dblohm7 commented Aug 9, 2023

The landing of this PR broke SddlToSecurityDescriptor.

This line should not be using unsafe.Sizeof(windows.SECURITY_DESCRIPTOR{}) to determine the length; it should use sd.Length().

dblohm7 added a commit to dblohm7/go-winio that referenced this issue Aug 9, 2023
…yDescriptor

unsafe.Sizeof(windows.SECURITY_DESCRIPTOR{}) is the minimum length of the SD,
not the actual length. Use the actual length for computing the length of the
slice.

This path also removes getSecurityDescriptorLength, which is no longer used.

Fixes microsoft#298

Signed-off-by: Aaron Klotz <aaron@tailscale.com>
dblohm7 added a commit to dblohm7/go-winio that referenced this issue Aug 9, 2023
…yDescriptor

unsafe.Sizeof(windows.SECURITY_DESCRIPTOR{}) is the minimum length of the SD,
not the actual length. Use the actual length for computing the length of the
slice.

This path also removes getSecurityDescriptorLength, which is no longer used.

Fixes microsoft#298

Signed-off-by: Aaron Klotz <aaron@tailscale.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant