safesocket: enable test to run on Windows unpriviliged

I manually tested that the code path that relaxes pipe permissions is
not executed when run with elevated priviliges, and the test also passes
in that case.

Updates #7876

Signed-off-by: James Tucker <jftucker@gmail.com>
This commit is contained in:
James Tucker
2023-04-14 16:52:44 -07:00
parent cd35a79136
commit f844791e15
3 changed files with 28 additions and 4 deletions
+2 -1
View File
@@ -24,7 +24,8 @@ func setFlags(network, address string, c syscall.RawConn) error {
// windowsSDDL is the Security Descriptor set on the namedpipe.
// It provides read/write access to all users and the local system.
const windowsSDDL = "O:BAG:BAD:PAI(A;OICI;GWGR;;;BU)(A;OICI;GWGR;;;SY)"
// It is a var for testing, do not change this value.
var windowsSDDL = "O:BAG:BAD:PAI(A;OICI;GWGR;;;BU)(A;OICI;GWGR;;;SY)"
func listen(path string) (net.Listener, error) {
lc, err := winio.ListenPipe(