1 Return-Path: <jani@nikula.org>
\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 52DF0431FC2
\r
6 for <notmuch@notmuchmail.org>; Sun, 5 May 2013 12:18:36 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"
\r
12 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
13 tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 Ibbu4LDRCJBp for <notmuch@notmuchmail.org>;
\r
17 Sun, 5 May 2013 12:18:31 -0700 (PDT)
\r
18 Received: from mail-la0-f54.google.com (mail-la0-f54.google.com
\r
19 [209.85.215.54]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id 77338431FAF
\r
22 for <notmuch@notmuchmail.org>; Sun, 5 May 2013 12:18:31 -0700 (PDT)
\r
23 Received: by mail-la0-f54.google.com with SMTP id fd20so2792525lab.13
\r
24 for <notmuch@notmuchmail.org>; Sun, 05 May 2013 12:18:29 -0700 (PDT)
\r
25 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
\r
26 d=google.com; s=20120113;
\r
27 h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to
\r
28 :references:in-reply-to:references:x-gm-message-state;
\r
29 bh=5tNUn1jY6e6wO083LbMGb5kYv1FhDGZ2zIA44fcygpA=;
\r
30 b=mMX4bpu0cEz9JIC/7w5VBN6PBmbQvaU1GQcVq/FTuXQLxPFSKyNNEPuKoopJubRvzA
\r
31 1BgN3GWHKPpf9fvbXCnOo4iOF0tGTdQ24DrfMh9mLMINOGSpuPOA+4ubKRKgBKdw4PyA
\r
32 GWjLtvURnyjpVoWCjRpPGrHlyfyx4wN+Mkn9j+qeUdxITFGgFMIBtSqgECAcpuSNT4TD
\r
33 LS8QXiK8lVEpzLwlUeq3lc5KJ3BQ+ygtOSSZzj/u2iZbzctB6IRLVZ8ppvtRbsVnRCRW
\r
34 7VA2gUZxtzTx5/xP0t6w/rmwWLlDcTiRxFY7iO07I+6hOX7Yqy9ECz4D9qbyo7+/8XD0
\r
36 X-Received: by 10.152.2.196 with SMTP id 4mr7039340law.4.1367781509834;
\r
37 Sun, 05 May 2013 12:18:29 -0700 (PDT)
\r
38 Received: from localhost (dsl-hkibrasgw2-58c376-211.dhcp.inet.fi.
\r
40 by mx.google.com with ESMTPSA id 2sm3837120lay.5.2013.05.05.12.18.28
\r
41 for <multiple recipients>
\r
42 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
\r
43 Sun, 05 May 2013 12:18:29 -0700 (PDT)
\r
44 From: Jani Nikula <jani@nikula.org>
\r
45 To: notmuch@notmuchmail.org
\r
46 Subject: [PATCH 2/2] cli: config: fix config file save when the file does not
\r
48 Date: Sun, 5 May 2013 22:18:20 +0300
\r
50 <66bdb2255d3a5ec573ac2a935663e9f767610d36.1367781422.git.jani@nikula.org>
\r
51 X-Mailer: git-send-email 1.7.10.4
\r
53 <9971e27c7c3fe569765bbca0f21de128ad1e4fac.1367781422.git.jani@nikula.org>
\r
55 <9971e27c7c3fe569765bbca0f21de128ad1e4fac.1367781422.git.jani@nikula.org>
\r
57 <9971e27c7c3fe569765bbca0f21de128ad1e4fac.1367781422.git.jani@nikula.org>
\r
59 <9971e27c7c3fe569765bbca0f21de128ad1e4fac.1367781422.git.jani@nikula.org>
\r
61 ALoCoQlYtu6/ccs0Sugw4PsV4PR99KP1soIemcIR6n4k/jof+3bQpuEISQYnEo8l7tEGvySBxvG3
\r
62 Cc: Tomi Ollila <tomi.ollila@iki.fi>
\r
63 X-BeenThere: notmuch@notmuchmail.org
\r
64 X-Mailman-Version: 2.1.13
\r
66 List-Id: "Use and development of the notmuch mail system."
\r
67 <notmuch.notmuchmail.org>
\r
68 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
69 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
70 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
71 List-Post: <mailto:notmuch@notmuchmail.org>
\r
72 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
73 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
74 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
75 X-List-Received-Date: Sun, 05 May 2013 19:18:36 -0000
\r
77 The use of realpath(3) in
\r
78 commit 58ed67992d0ec1fa505026105218fa449f7980b0
\r
79 Author: Jani Nikula <jani@nikula.org>
\r
80 Date: Sun Apr 7 20:15:03 2013 +0300
\r
82 cli: config: do not overwrite symlinks when saving config file
\r
84 broke config file save when the file does not exist, which results in
\r
85 'notmuch setup' always failing to create a new config file.
\r
87 Fix by checking ENOENT from realpath(3).
\r
89 notmuch-config.c | 17 +++++++++++++----
\r
91 2 files changed, 13 insertions(+), 5 deletions(-)
\r
93 diff --git a/notmuch-config.c b/notmuch-config.c
\r
94 index d9c2eb3..befe9b5 100644
\r
95 --- a/notmuch-config.c
\r
96 +++ b/notmuch-config.c
\r
97 @@ -456,10 +456,19 @@ notmuch_config_save (notmuch_config_t *config)
\r
98 /* Try not to overwrite symlinks. */
\r
99 filename = realpath (config->filename, NULL);
\r
101 - fprintf (stderr, "Error canonicalizing %s: %s\n", config->filename,
\r
102 - strerror (errno));
\r
105 + if (errno == ENOENT) {
\r
106 + filename = strdup (config->filename);
\r
107 + if (! filename) {
\r
108 + fprintf (stderr, "Out of memory.\n");
\r
113 + fprintf (stderr, "Error canonicalizing %s: %s\n", config->filename,
\r
114 + strerror (errno));
\r
120 if (! g_file_set_contents (filename, data, length, &error)) {
\r
121 diff --git a/test/setup b/test/setup
\r
122 index 8cc5576..124ef1c 100755
\r
125 @@ -4,7 +4,6 @@ test_description='"notmuch setup"'
\r
128 test_begin_subtest "Create a new config interactively"
\r
129 -test_subtest_known_broken
\r
130 notmuch --config=new-notmuch-config > /dev/null <<EOF
\r
132 test.suite@example.com
\r