Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 375AA431FAF for ; Wed, 29 May 2013 11:21:45 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.098 X-Spam-Level: X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5 tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001, NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 67pEb9kZtAJY for ; Wed, 29 May 2013 11:21:34 -0700 (PDT) Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id A48F9431FAE for ; Wed, 29 May 2013 11:21:34 -0700 (PDT) Received: from smtp.qmul.ac.uk ([138.37.6.40]) by mail2.qmul.ac.uk with esmtp (Exim 4.71) (envelope-from ) id 1Uhl01-00078L-EK; Wed, 29 May 2013 19:21:30 +0100 Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost) by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71) (envelope-from ) id 1Uhl01-0002Kl-2I; Wed, 29 May 2013 19:21:25 +0100 From: Mark Walters To: Tomi Ollila , notmuch@notmuchmail.org Subject: Re: v3 of --stderr=FILE patches In-Reply-To: <1369766335-26733-1-git-send-email-tomi.ollila@iki.fi> References: <1369766335-26733-1-git-send-email-tomi.ollila@iki.fi> User-Agent: Notmuch/0.14+255~gff3cc55 (http://notmuchmail.org) Emacs/23.4.1 (i486-pc-linux-gnu) Date: Wed, 29 May 2013 19:21:23 +0100 Message-ID: <87r4gphckc.fsf@qmul.ac.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Sender-Host-Address: 93.97.24.31 X-QM-SPAM-Info: Sender has good ham record. :) X-QM-Body-MD5: 00d4f7f818f2e6f492cbc3905e81a692 (of first 20000 bytes) X-SpamAssassin-Score: -0.1 X-SpamAssassin-SpamBar: / X-SpamAssassin-Report: The QM spam filters have analysed this message to determine if it is spam. We require at least 5.0 points to mark a message as spam. This message scored -0.1 points. Summary of the scoring: * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider * (markwalters1009[at]gmail.com) * -0.1 AWL AWL: From: address is in the auto white-list X-QM-Scan-Virus: ClamAV says the message is clean Cc: tomi.ollila@iki.fi X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 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: Wed, 29 May 2013 18:21:45 -0000 Just confirming LGTM +1 for this version too. Best wishes Mark Tomi Ollila writes: > This is v3 of id:1369557954-13439-1-git-send-email-tomi.ollila@iki.fi > > In id:m2a9nfr4tb.fsf@guru.guru-group.fi I suggested to use 0600 as > permission bits so that files written to /tmp would not have write > bits set in any case. That would have been inconsistent what is > normally expected in redirection cases. The problem I described > is easily avoided in emacs as (make-temp-file "nmerr") will create > file "/tmp/nmerrXXXXXX" with permissions 0600 -- and writing to > that already-created file will not change its permissions. Writing > elsewhere is usually covered with directory permissions. > > > Diffdiff from v2 is shown below. > > diff --git a/NEWS b/NEWS > index 990b038..80abd97 100644 > --- a/NEWS > +++ b/NEWS > @@ -38,8 +38,7 @@ Top level option to specify configuration file > Top level option to redirect writes to stderr > > With `notmuch --stderr=FILE` all writes to stderr are redirected to > - the specified file. If the file name is a plain '-', stderr is > - written to stdout. > + the specified file. If FILE is '-', stderr is redirected to stdout. > > Deprecated commands "part" and "search-tags" are removed. > > diff --git a/man/man1/notmuch.1 b/man/man1/notmuch.1 > index fbd575a..f5ca0ad 100644 > --- a/man/man1/notmuch.1 > +++ b/man/man1/notmuch.1 > @@ -83,7 +83,7 @@ configuration file specified by ${NOTMUCH_CONFIG}. > .B \-\-stderr=FILE > > Redirect all writes to stderr to the specified file. > -If the file name is a plain '-', stderr is written to stdout. > +If FILE is '-', stderr is redirected to stdout. > .RE > > .SH COMMANDS > diff --git a/notmuch.c b/notmuch.c > index 654a568..15e90c8 100644 > --- a/notmuch.c > +++ b/notmuch.c > @@ -260,7 +260,7 @@ redirect_stderr (const char * stderr_file) > return 1; > } > } else { > - int fd = open (stderr_file, O_WRONLY|O_CREAT|O_APPEND, 0644); > + int fd = open (stderr_file, O_WRONLY|O_CREAT|O_TRUNC, 0666); > if (fd < 0) { > fprintf (stderr, "Error: Cannot redirect stderr to '%s': %s\n", > stderr_file, strerror (errno)); > > > From Tomi Ollila # This line is ignored. > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch