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:
Gregory Anders 2021-06-14 09:57:13 -06:00 committed by Simon Ser
parent 387338e499
commit cacbd48949

View File

@ -129,12 +129,12 @@ func (ms *fsMessageStore) Append(network *network, entity string, msg *irc.Messa
}
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)
}
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 {
return "", fmt.Errorf("failed to open message log file %q: %v", path, err)
}