WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 536df70

Browse files
committed
Set correct SECURITY_INFORMATION bit
Prior to this change we were setting `OWNER_SECURITY_INFORMATION` along with `DACL_SECURITY_INFORMATION`. Since we are not touching the owner, I don't think we need to set this. Furthermore, the test was failing because the DACL was actually protected (`D:P(A;;GA;;;BA)(A;;GA;;;SY)`) and we need to tell the API about it. Setting `PROTECTED_DACL_SECURITY_INFORMATION` fixes the issue and allows socket creation with the required security descriptor. Signed-off-by: Craig Gumbley <[email protected]>
1 parent d61b17e commit 536df70

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sockets/unix_socket_windows.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func withSDDL(sddl string) SockOption {
7676
return windows.SetNamedSecurityInfo(
7777
path,
7878
windows.SE_FILE_OBJECT,
79-
windows.DACL_SECURITY_INFORMATION|windows.OWNER_SECURITY_INFORMATION,
79+
windows.DACL_SECURITY_INFORMATION|windows.PROTECTED_DACL_SECURITY_INFORMATION,
8080
nil, // do not change the owner
8181
nil, // do not change the owner
8282
dacl,

0 commit comments

Comments
 (0)