~emersion/soju-dev

Slightly relax new log file permissions v1 APPLIED

Gregory Anders: 1
 Slightly relax new log file permissions

 1 files changed, 2 insertions(+), 2 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~emersion/soju-dev/patches/23302/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH] Slightly relax new log file permissions Export this patch

Make new log files group-readable by default. To retain the prior
behavior, soju can be started with a umask set to 0077.
---
 msgstore_fs.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/msgstore_fs.go b/msgstore_fs.go
index d17859d..5f7025b 100644
--- a/msgstore_fs.go
+++ b/msgstore_fs.go
@@ -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)
		}
-- 
2.32.0
Pushed, thanks!
Pushed, thanks!