Re: v3 of --stderr=FILE patches
[notmuch-archives.git] / f9 / e3a9b4ebb47421accbdfce5ac276ddf57e9bfc
1 Return-Path: <m.walters@qmul.ac.uk>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 375AA431FAF\r
6         for <notmuch@notmuchmail.org>; Wed, 29 May 2013 11:21:45 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -1.098\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5\r
12         tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001,\r
13         NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id 67pEb9kZtAJY for <notmuch@notmuchmail.org>;\r
17         Wed, 29 May 2013 11:21:34 -0700 (PDT)\r
18 Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6])\r
19         (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id A48F9431FAE\r
22         for <notmuch@notmuchmail.org>; Wed, 29 May 2013 11:21:34 -0700 (PDT)\r
23 Received: from smtp.qmul.ac.uk ([138.37.6.40])\r
24         by mail2.qmul.ac.uk with esmtp (Exim 4.71)\r
25         (envelope-from <m.walters@qmul.ac.uk>)\r
26         id 1Uhl01-00078L-EK; Wed, 29 May 2013 19:21:30 +0100\r
27 Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost)\r
28         by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71)\r
29         (envelope-from <m.walters@qmul.ac.uk>)\r
30         id 1Uhl01-0002Kl-2I; Wed, 29 May 2013 19:21:25 +0100\r
31 From: Mark Walters <markwalters1009@gmail.com>\r
32 To: Tomi Ollila <tomi.ollila@iki.fi>, notmuch@notmuchmail.org\r
33 Subject: Re: v3 of --stderr=FILE patches\r
34 In-Reply-To: <1369766335-26733-1-git-send-email-tomi.ollila@iki.fi>\r
35 References: <1369766335-26733-1-git-send-email-tomi.ollila@iki.fi>\r
36 User-Agent: Notmuch/0.14+255~gff3cc55 (http://notmuchmail.org) Emacs/23.4.1\r
37         (i486-pc-linux-gnu)\r
38 Date: Wed, 29 May 2013 19:21:23 +0100\r
39 Message-ID: <87r4gphckc.fsf@qmul.ac.uk>\r
40 MIME-Version: 1.0\r
41 Content-Type: text/plain; charset=us-ascii\r
42 X-Sender-Host-Address: 93.97.24.31\r
43 X-QM-SPAM-Info: Sender has good ham record.  :)\r
44 X-QM-Body-MD5: 00d4f7f818f2e6f492cbc3905e81a692 (of first 20000 bytes)\r
45 X-SpamAssassin-Score: -0.1\r
46 X-SpamAssassin-SpamBar: /\r
47 X-SpamAssassin-Report: The QM spam filters have analysed this message to\r
48         determine if it is\r
49         spam. We require at least 5.0 points to mark a message as spam.\r
50         This message scored -0.1 points.\r
51         Summary of the scoring: \r
52         * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\r
53         provider *      (markwalters1009[at]gmail.com)\r
54         * -0.1 AWL AWL: From: address is in the auto white-list\r
55 X-QM-Scan-Virus: ClamAV says the message is clean\r
56 Cc: tomi.ollila@iki.fi\r
57 X-BeenThere: notmuch@notmuchmail.org\r
58 X-Mailman-Version: 2.1.13\r
59 Precedence: list\r
60 List-Id: "Use and development of the notmuch mail system."\r
61         <notmuch.notmuchmail.org>\r
62 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
63         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
64 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
65 List-Post: <mailto:notmuch@notmuchmail.org>\r
66 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
67 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
68         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
69 X-List-Received-Date: Wed, 29 May 2013 18:21:45 -0000\r
70 \r
71 \r
72 Just confirming LGTM +1 for this version too.\r
73 \r
74 Best wishes\r
75 \r
76 Mark\r
77 \r
78 Tomi Ollila <tomi.ollila@iki.fi> writes:\r
79 \r
80 > This is v3 of id:1369557954-13439-1-git-send-email-tomi.ollila@iki.fi\r
81 >\r
82 > In id:m2a9nfr4tb.fsf@guru.guru-group.fi I suggested to use 0600 as\r
83 > permission bits so that files written to /tmp would not have write\r
84 > bits set in any case. That would have been inconsistent what is\r
85 > normally expected in redirection cases. The problem I described\r
86 > is easily avoided in emacs as (make-temp-file "nmerr") will create\r
87 > file "/tmp/nmerrXXXXXX" with permissions 0600 -- and writing to\r
88 > that already-created file will not change its permissions. Writing\r
89 > elsewhere is usually covered with directory permissions.\r
90 >\r
91 >\r
92 > Diffdiff from v2 is shown below.\r
93 >\r
94 > diff --git a/NEWS b/NEWS\r
95 > index 990b038..80abd97 100644\r
96 > --- a/NEWS\r
97 > +++ b/NEWS\r
98 > @@ -38,8 +38,7 @@ Top level option to specify configuration file\r
99 >  Top level option to redirect writes to stderr\r
100 >  \r
101 >    With `notmuch --stderr=FILE` all writes to stderr are redirected to\r
102 > -  the specified file. If the file name is a plain '-', stderr is\r
103 > -  written to stdout.\r
104 > +  the specified file. If FILE is '-', stderr is redirected to stdout.\r
105 >  \r
106 >  Deprecated commands "part" and "search-tags" are removed.\r
107 >  \r
108 > diff --git a/man/man1/notmuch.1 b/man/man1/notmuch.1\r
109 > index fbd575a..f5ca0ad 100644\r
110 > --- a/man/man1/notmuch.1\r
111 > +++ b/man/man1/notmuch.1\r
112 > @@ -83,7 +83,7 @@ configuration file specified by ${NOTMUCH_CONFIG}.\r
113 >  .B \-\-stderr=FILE\r
114 >  \r
115 >  Redirect all writes to stderr to the specified file.\r
116 > -If the file name is a plain '-', stderr is written to stdout.\r
117 > +If FILE is '-', stderr is redirected to stdout.\r
118 >  .RE\r
119 >  \r
120 >  .SH COMMANDS\r
121 > diff --git a/notmuch.c b/notmuch.c\r
122 > index 654a568..15e90c8 100644\r
123 > --- a/notmuch.c\r
124 > +++ b/notmuch.c\r
125 > @@ -260,7 +260,7 @@ redirect_stderr (const char * stderr_file)\r
126 >           return 1;\r
127 >       }\r
128 >      } else {\r
129 > -     int fd = open (stderr_file, O_WRONLY|O_CREAT|O_APPEND, 0644);\r
130 > +     int fd = open (stderr_file, O_WRONLY|O_CREAT|O_TRUNC, 0666);\r
131 >       if (fd < 0) {\r
132 >           fprintf (stderr, "Error: Cannot redirect stderr to '%s': %s\n",\r
133 >                    stderr_file, strerror (errno));\r
134 >\r
135 >\r
136 > From Tomi Ollila <tomi.ollila@iki.fi> # This line is ignored.\r
137 >\r
138 > _______________________________________________\r
139 > notmuch mailing list\r
140 > notmuch@notmuchmail.org\r
141 > http://notmuchmail.org/mailman/listinfo/notmuch\r