Set umask=0 when creating unix sockets (#743)
Signed-off-by: eternal-flame-AD <yume@yumechi.jp>
This commit is contained in:
parent
cc7da2ace3
commit
c81a9a2c88
|
|
@ -77,6 +77,9 @@ func startListening(connectionType, listenAddr string, port, keepAlive int) (net
|
|||
network, addr := getNetworkAndAddr(listenAddr, port)
|
||||
lc := net.ListenConfig{KeepAlive: time.Duration(keepAlive) * time.Second}
|
||||
|
||||
oldMask := umask(0)
|
||||
defer umask(oldMask)
|
||||
|
||||
l, err := lc.Listen(context.Background(), network, addr)
|
||||
if err == nil {
|
||||
fmt.Println("Started listening for", connectionType, "on", l.Addr().Network(), l.Addr().String())
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
//go:build unix
|
||||
|
||||
package runner
|
||||
|
||||
import "syscall"
|
||||
|
||||
var umask = syscall.Umask
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
//go:build !unix
|
||||
|
||||
package runner
|
||||
|
||||
func umask(_ int) int {
|
||||
return 0
|
||||
}
|
||||
Loading…
Reference in New Issue