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 6E38A431FAF
\r
6 for <notmuch@notmuchmail.org>; Thu, 7 Aug 2014 11:24:17 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_MED=-2.3] 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 WSaZ3dUdM1Kw for <notmuch@notmuchmail.org>;
\r
16 Thu, 7 Aug 2014 11:24:11 -0700 (PDT)
\r
17 Received: from dmz-mailsec-scanner-8.mit.edu (dmz-mailsec-scanner-8.mit.edu
\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 296E9431FAE
\r
22 for <notmuch@notmuchmail.org>; Thu, 7 Aug 2014 11:24:11 -0700 (PDT)
\r
23 X-AuditID: 12074425-f79766d000006da8-74-53e3c44a11d0
\r
24 Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])
\r
25 (using TLS with cipher AES256-SHA (256/256 bits))
\r
26 (Client did not present a certificate)
\r
27 by dmz-mailsec-scanner-8.mit.edu (Symantec Messaging Gateway) with SMTP
\r
28 id FD.9A.28072.A44C3E35; Thu, 7 Aug 2014 14:24:10 -0400 (EDT)
\r
29 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])
\r
30 by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id s77IO8F6003230;
\r
31 Thu, 7 Aug 2014 14:24:09 -0400
\r
32 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])
\r
33 (authenticated bits=0)
\r
34 (User authenticated as amdragon@ATHENA.MIT.EDU)
\r
35 by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id s77IO50K004386
\r
36 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT);
\r
37 Thu, 7 Aug 2014 14:24:07 -0400
\r
38 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.80)
\r
39 (envelope-from <amdragon@mit.edu>)
\r
40 id 1XFSM8-0001j4-Ag; Thu, 07 Aug 2014 14:24:04 -0400
\r
41 Date: Thu, 7 Aug 2014 14:24:03 -0400
\r
42 From: Austin Clements <amdragon@MIT.EDU>
\r
43 To: Tomi Ollila <tomi.ollila@iki.fi>
\r
44 Subject: Re: [PATCH] notmuch-config: talloc_strdup MAILDIR and NAME
\r
45 environment variables
\r
46 Message-ID: <20140807182402.GA4741@mit.edu>
\r
47 References: <1407424790-12538-1-git-send-email-tomi.ollila@iki.fi>
\r
49 Content-Type: text/plain; charset=us-ascii
\r
50 Content-Disposition: inline
\r
51 In-Reply-To: <1407424790-12538-1-git-send-email-tomi.ollila@iki.fi>
\r
52 User-Agent: Mutt/1.5.21 (2010-09-15)
\r
53 X-Brightmail-Tracker:
\r
54 H4sIAAAAAAAAA+NgFmpileLIzCtJLcpLzFFi42IRYrdT1/U68jjY4N0lGYvrN2cyW7xZOY/V
\r
55 gcnj8NeFLB7PVt1iDmCK4rJJSc3JLEst0rdL4Mpo2rqapaCBs2LTfr0Gxt9sXYycHBICJhJn
\r
56 LpxnhLDFJC7cWw8U5+IQEpjNJHHu5zMWCGcDo8TUO9uhnFNMEjMXHWeFcJYwShz/3MEO0s8i
\r
57 oCIxc/0bZhCbTUBDYtv+5WBzRYDiD9rWs4LYzALSEt9+NzOB2MIC0RKrZj4Gi/MKaEvs/3WZ
\r
58 BcQWEnCS+PdxHxtEXFDi5MwnLBC9WhI3/r0E6uUAm7P8HweIySngLPHyRABIhSjQpiknt7FN
\r
59 YBSahaR5FpLmWQjNCxiZVzHKpuRW6eYmZuYUpybrFicn5uWlFula6OVmluilppRuYgQHtYvq
\r
60 DsYJh5QOMQpwMCrx8Ap0Pw4WYk0sK67MPcQoycGkJMrbuR8oxJeUn1KZkVicEV9UmpNafIhR
\r
61 goNZSYRXF6ScNyWxsiq1KB8mJc3BoiTO+9baKlhIID2xJDU7NbUgtQgmK8PBoSTBy3sYqFGw
\r
62 KDU9tSItM6cEIc3EwQkynAdoeAdIDW9xQWJucWY6RP4Uo6KUOO/ZQ0AJAZBERmkeXC8s6bxi
\r
63 FAd6RZg3B6SdB5iw4LpfAQ1mAhosqwo2uCQRISXVwOjW997aRviB/63SnYeuHllT9Sz8xYl1
\r
64 zybIPV8d9Vh446cZu36evXfj+2yTNTvn3zld7r1ocluly/GSCrPPU555ZIs9rD/r8kPxjklu
\r
65 VUGQ4Ku7St2sz7/ujXxxaOPHIzODfofbzXU02dcdslWx9ExGsfqDTybJjQevMKpyWN54HLH5
\r
66 2RkNO90aJZbijERDLeai4kQAKd3h0xUDAAA=
\r
67 Cc: notmuch@notmuchmail.org
\r
68 X-BeenThere: notmuch@notmuchmail.org
\r
69 X-Mailman-Version: 2.1.13
\r
71 List-Id: "Use and development of the notmuch mail system."
\r
72 <notmuch.notmuchmail.org>
\r
73 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
74 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
75 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
76 List-Post: <mailto:notmuch@notmuchmail.org>
\r
77 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
78 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
79 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
80 X-List-Received-Date: Thu, 07 Aug 2014 18:24:17 -0000
\r
84 Quoth Tomi Ollila on Aug 07 at 6:19 pm:
\r
85 > When defined -- the pointer is soon given to talloc_free() which
\r
86 > expects it to be allocated by talloc.
\r
88 > notmuch-config.c | 8 ++++++--
\r
89 > 1 file changed, 6 insertions(+), 2 deletions(-)
\r
91 > diff --git a/notmuch-config.c b/notmuch-config.c
\r
92 > index 88831e2..db487db 100644
\r
93 > --- a/notmuch-config.c
\r
94 > +++ b/notmuch-config.c
\r
95 > @@ -324,7 +324,9 @@ notmuch_config_open (void *ctx,
\r
97 > if (notmuch_config_get_database_path (config) == NULL) {
\r
98 > char *path = getenv ("MAILDIR");
\r
101 > + path = talloc_strdup (config, path);
\r
103 > path = talloc_asprintf (config, "%s/mail",
\r
104 > getenv ("HOME"));
\r
105 > notmuch_config_set_database_path (config, path);
\r
106 > @@ -333,7 +335,9 @@ notmuch_config_open (void *ctx,
\r
108 > if (notmuch_config_get_user_name (config) == NULL) {
\r
109 > char *name = getenv ("NAME");
\r
112 > + name = talloc_strdup (config, name);
\r
114 > name = get_name_from_passwd_file (config);
\r
115 > notmuch_config_set_user_name (config, name);
\r
116 > talloc_free (name);
\r