unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
To: Notmuch Mail <notmuch@notmuchmail.org>
Subject: [PATCH] cli/insert: new message file can be world-readable (rely on umask)
Date: Sun,  4 Feb 2018 23:37:03 -0500	[thread overview]
Message-ID: <20180205043703.22551-1-dkg@fifthhorseman.net> (raw)

There are legitimate cases (public archives) where a user might
actually want their archive to be readable to the world.

"notmuch insert" historically used mode 0600 (unreadable by group or
other), but that choice doesn't appear to have been specifically
justified (perhaps an abundance of caution?).

If the user wants "notmuch insert" to create files that are not
readable by group or other, they can set their umask more
restrictively.
---
 notmuch-insert.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/notmuch-insert.c b/notmuch-insert.c
index 48490b51..167005db 100644
--- a/notmuch-insert.c
+++ b/notmuch-insert.c
@@ -227,7 +227,7 @@ maildir_mktemp (const void *ctx, const char *maildir, char **path_out)
 	    return -1;
 	}
 
-	fd = open (path, O_WRONLY | O_CREAT | O_TRUNC | O_EXCL, 0600);
+	fd = open (path, O_WRONLY | O_CREAT | O_TRUNC | O_EXCL, 0644);
     } while (fd == -1 && errno == EEXIST);
 
     if (fd == -1) {
-- 
2.15.1

             reply	other threads:[~2018-02-05  4:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-05  4:37 Daniel Kahn Gillmor [this message]
2018-02-05 11:59 ` [PATCH] cli/insert: new message file can be world-readable (rely on umask) Peter Wang
2018-02-06 19:43   ` [PATCH v2] " Daniel Kahn Gillmor
2018-02-09  1:40     ` Daniel Kahn Gillmor
2018-02-09  1:52       ` Brian Sniffen
2018-02-09  2:33         ` Daniel Kahn Gillmor
2018-02-09  2:00       ` Daniel Kahn Gillmor
2018-02-09  4:10       ` [PATCH v3] cli/insert: add --world-readable flag Daniel Kahn Gillmor
2018-02-15  6:08         ` Tomi Ollila
2018-03-24 23:17         ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180205043703.22551-1-dkg@fifthhorseman.net \
    --to=dkg@fifthhorseman.net \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).