UNIX socket creation - Don't chmod if mode not set

This commit is contained in:
Emmanuel BENOîT 2021-10-31 09:12:26 +01:00
parent 610cbf28f8
commit e6aaa09795

View file

@ -24,10 +24,12 @@ func configureSocket(cfg tSocketConfig) error {
}
}
if cfg.Mode != 0 {
err := os.Chmod(cfg.Path, cfg.Mode)
if err != nil {
return fmt.Errorf("Cannot set UNIX socket access mode: %w", err)
}
}
return nil
}