~emersion/soju

cacbd4894902833fff024e2e51d7d0ec42ad5926 — Gregory Anders a month ago 387338e
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.
1 files changed, 2 insertions(+), 2 deletions(-)

M msgstore_fs.go
M msgstore_fs.go => msgstore_fs.go +2 -2
@@ 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)
		}