From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id AA21B6DE0183 for ; Sun, 4 Feb 2018 20:37:09 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.007 X-Spam-Level: X-Spam-Status: No, score=-0.007 tagged_above=-999 required=5 tests=[AWL=-0.007] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Bw0vLYKgRU7N for ; Sun, 4 Feb 2018 20:37:08 -0800 (PST) Received: from che.mayfirst.org (che.mayfirst.org [162.247.75.118]) by arlo.cworth.org (Postfix) with ESMTPS id 3606F6DE010F for ; Sun, 4 Feb 2018 20:37:08 -0800 (PST) Received: from fifthhorseman.net (ool-6c3a0662.static.optonline.net [108.58.6.98]) by che.mayfirst.org (Postfix) with ESMTPSA id 76663F99A for ; Sun, 4 Feb 2018 23:37:07 -0500 (EST) Received: by fifthhorseman.net (Postfix, from userid 1000) id 9A5FD20529; Sun, 4 Feb 2018 23:37:03 -0500 (EST) From: Daniel Kahn Gillmor To: Notmuch Mail Subject: [PATCH] cli/insert: new message file can be world-readable (rely on umask) Date: Sun, 4 Feb 2018 23:37:03 -0500 Message-Id: <20180205043703.22551-1-dkg@fifthhorseman.net> X-Mailer: git-send-email 2.15.1 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Feb 2018 04:37:09 -0000 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