UNIX socket creation - Don't chmod if mode not set
This commit is contained in:
parent
610cbf28f8
commit
e6aaa09795
1 changed files with 5 additions and 3 deletions
|
@ -24,9 +24,11 @@ func configureSocket(cfg tSocketConfig) error {
|
|||
}
|
||||
}
|
||||
|
||||
err := os.Chmod(cfg.Path, cfg.Mode)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Cannot set UNIX socket access mode: %w", err)
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue