1 Return-Path: <amdragon@mit.edu>
\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 BF82A429E36
\r
6 for <notmuch@notmuchmail.org>; Thu, 17 May 2012 21:13:58 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id 9ZGC7s0Fsyse for <notmuch@notmuchmail.org>;
\r
16 Thu, 17 May 2012 21:13:57 -0700 (PDT)
\r
17 Received: from dmz-mailsec-scanner-6.mit.edu (DMZ-MAILSEC-SCANNER-6.MIT.EDU
\r
19 by olra.theworths.org (Postfix) with ESMTP id 588D0431E82
\r
20 for <notmuch@notmuchmail.org>; Thu, 17 May 2012 21:13:53 -0700 (PDT)
\r
21 X-AuditID: 12074423-b7fcc6d0000008a8-38-4fb5cc8089a0
\r
22 Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])
\r
23 by dmz-mailsec-scanner-6.mit.edu (Symantec Messaging Gateway) with SMTP
\r
24 id 10.83.02216.08CC5BF4; Fri, 18 May 2012 00:13:52 -0400 (EDT)
\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])
\r
26 by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id q4I4Dq4Y029945;
\r
27 Fri, 18 May 2012 00:13:52 -0400
\r
28 Received: from drake.mit.edu
\r
29 (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com
\r
30 [209.6.116.242]) (authenticated bits=0)
\r
31 (User authenticated as amdragon@ATHENA.MIT.EDU)
\r
32 by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q4I4Dpi4026792
\r
33 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);
\r
34 Fri, 18 May 2012 00:13:51 -0400 (EDT)
\r
35 Received: from amthrax by drake.mit.edu with local (Exim 4.77)
\r
36 (envelope-from <amdragon@mit.edu>)
\r
37 id 1SVEZa-0000zF-U8; Fri, 18 May 2012 00:13:50 -0400
\r
38 From: Austin Clements <amdragon@MIT.EDU>
\r
39 To: notmuch@notmuchmail.org
\r
40 Subject: [PATCH 7/9] lib: Make notmuch_database_find_message_by_filename not
\r
41 crash on read-only databases
\r
42 Date: Fri, 18 May 2012 00:13:40 -0400
\r
43 Message-Id: <1337314423-3702-8-git-send-email-amdragon@mit.edu>
\r
44 X-Mailer: git-send-email 1.7.10
\r
45 In-Reply-To: <1337314423-3702-1-git-send-email-amdragon@mit.edu>
\r
46 References: <1337314423-3702-1-git-send-email-amdragon@mit.edu>
\r
47 X-Brightmail-Tracker:
\r
48 H4sIAAAAAAAAA+NgFtrEIsWRmVeSWpSXmKPExsUixCmqrNtwZqu/wYw5xhbXb85kdmD0eLbq
\r
49 FnMAYxSXTUpqTmZZapG+XQJXxo+jG9kLrrBXrP/3i6WBcSVbFyMnh4SAiUT37m52CFtM4sK9
\r
50 9UBxLg4hgX2MEgcvNkI5GxglPvxexALh3GeSmPduM1RmFqPE7Y7PjCD9bAIaEtv2LwezRQSk
\r
51 JXbenc3axcjBwSygJvGnSwUkLCyQKdF7/SkriM0ioCpx9d5qJhCbV8BeYvuhtVAnyUs8vd/H
\r
52 BtLKKeAgMe14NEhYCKjk34VmlgmM/AsYGVYxyqbkVunmJmbmFKcm6xYnJ+blpRbpmunlZpbo
\r
53 paaUbmIEBQ27i/IOxj8HlQ4xCnAwKvHw7piz1V+INbGsuDL3EKMkB5OSKO/3k0AhvqT8lMqM
\r
54 xOKM+KLSnNTiQ4wSHMxKIryy3UA53pTEyqrUonyYlDQHi5I4r4bWOz8hgfTEktTs1NSC1CKY
\r
55 rAwHh5IE76bTQI2CRanpqRVpmTklCGkmDk6Q4TxAwzNBaniLCxJzizPTIfKnGBWlxHl3gyQE
\r
56 QBIZpXlwvbCofsUoDvSKMO9ZkCoeYEKA634FNJgJaHBZ7iaQwSWJCCmpBsbkiafyDpQELHR0
\r
57 P+ctbdxSoG4bJnnpluUChfmGGeKK11RzgsOu1R4XsZxqIPHHX+DLxF2mswUF9VSmtRRtjd2j
\r
58 N8nhxnsxf6skrZ9ZOssPSbyZYlH/PO/41vnWq7uPKiueZNH81hs8l33vstdTfgRUXbuwd6nP
\r
59 8VU3r6lEr1m8of3ABslYGSElluKMREMt5qLiRADnP3UgxQIAAA==
\r
60 X-BeenThere: notmuch@notmuchmail.org
\r
61 X-Mailman-Version: 2.1.13
\r
63 List-Id: "Use and development of the notmuch mail system."
\r
64 <notmuch.notmuchmail.org>
\r
65 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
66 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
67 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
68 List-Post: <mailto:notmuch@notmuchmail.org>
\r
69 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
70 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
71 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
72 X-List-Received-Date: Fri, 18 May 2012 04:13:59 -0000
\r
74 Previously, _notmuch_database_filename_to_direntry would abort with an
\r
75 internal error when called on a read-only database. Now that creating
\r
76 the directory document is optional,
\r
77 notmuch_database_find_message_by_filename can disable directory
\r
78 document creation (as it should) and, as a result, not abort on
\r
79 read-only databases.
\r
81 lib/database.cc | 4 ++--
\r
82 1 file changed, 2 insertions(+), 2 deletions(-)
\r
84 diff --git a/lib/database.cc b/lib/database.cc
\r
85 index e27a0e1..761dc1a 100644
\r
86 --- a/lib/database.cc
\r
87 +++ b/lib/database.cc
\r
88 @@ -1895,8 +1895,8 @@ notmuch_database_find_message_by_filename (notmuch_database_t *notmuch,
\r
91 status = _notmuch_database_filename_to_direntry (
\r
92 - local, notmuch, filename, NOTMUCH_FIND_CREATE, &direntry);
\r
94 + local, notmuch, filename, NOTMUCH_FIND_LOOKUP, &direntry);
\r
95 + if (status || !direntry)
\r
98 term = talloc_asprintf (local, "%s%s", prefix, direntry);
\r