Slightly relax new log file permissions
Make new log files group-readable by default. To retain the prior behavior, soju can be started with a umask set to 0077.
This commit is contained in:
parent
387338e499
commit
cacbd48949
@ -129,12 +129,12 @@ func (ms *fsMessageStore) Append(network *network, entity string, msg *irc.Messa
|
|||||||
}
|
}
|
||||||
|
|
||||||
dir := filepath.Dir(path)
|
dir := filepath.Dir(path)
|
||||||
if err := os.MkdirAll(dir, 0700); err != nil {
|
if err := os.MkdirAll(dir, 0750); err != nil {
|
||||||
return "", fmt.Errorf("failed to create message logs directory %q: %v", dir, err)
|
return "", fmt.Errorf("failed to create message logs directory %q: %v", dir, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
f, err = os.OpenFile(path, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0600)
|
f, err = os.OpenFile(path, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0640)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", fmt.Errorf("failed to open message log file %q: %v", path, err)
|
return "", fmt.Errorf("failed to open message log file %q: %v", path, err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user