Drop permissions on Unix admin socket

This commit is contained in:
Simon Ser 2023-02-07 10:10:05 +01:00
parent 67ccc19fdd
commit bf931709db

View File

@ -220,6 +220,10 @@ func main() {
log.Fatalf("failed to start listener on %q: %v", listen, err)
}
ln = proxyProtoListener(ln, srv)
// TODO: this is racy
if err := os.Chmod(path, 0600); err != nil {
log.Fatalf("failed to chmod Unix admin socket: %v", err)
}
go func() {
if err := srv.Serve(ln, srv.HandleAdmin); err != nil {
log.Printf("serving %q: %v", listen, err)