From fd05ca08ca61e70c5565b42e7a05af1e38e04bec Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Sat, 12 Dec 2015 17:22:08 +1900 Subject: [PATCH] Re: [PATCH 6/9] search for a reasonable gpg implementation --- 7d/5ad5dbe7092d1b1f9259d1955f477716ca3f0f | 85 +++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 7d/5ad5dbe7092d1b1f9259d1955f477716ca3f0f diff --git a/7d/5ad5dbe7092d1b1f9259d1955f477716ca3f0f b/7d/5ad5dbe7092d1b1f9259d1955f477716ca3f0f new file mode 100644 index 000000000..8a4f1973c --- /dev/null +++ b/7d/5ad5dbe7092d1b1f9259d1955f477716ca3f0f @@ -0,0 +1,85 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by arlo.cworth.org (Postfix) with ESMTP id 56BD66DE13EF + for ; Fri, 11 Dec 2015 14:22:13 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: -0.015 +X-Spam-Level: +X-Spam-Status: No, score=-0.015 tagged_above=-999 required=5 + tests=[AWL=-0.015] autolearn=disabled +Received: from arlo.cworth.org ([127.0.0.1]) + by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 93i4Y17zxOFz for ; + Fri, 11 Dec 2015 14:22:11 -0800 (PST) +Received: from che.mayfirst.org (che.mayfirst.org [209.234.253.108]) + by arlo.cworth.org (Postfix) with ESMTP id 610636DE005F + for ; Fri, 11 Dec 2015 14:22:11 -0800 (PST) +Received: from fifthhorseman.net (unknown [38.109.115.130]) + by che.mayfirst.org (Postfix) with ESMTPSA id AC5C3F984; + Fri, 11 Dec 2015 17:22:08 -0500 (EST) +Received: by fifthhorseman.net (Postfix, from userid 1000) + id CCD90202B7; Fri, 11 Dec 2015 17:22:08 -0500 (EST) +From: Daniel Kahn Gillmor +To: "J. Lewis Muir" , Tomi Ollila , + Notmuch Mail +Subject: Re: [PATCH 6/9] search for a reasonable gpg implementation +In-Reply-To: <566B4BCC.7060203@imca-cat.org> +References: <1449718786-28000-1-git-send-email-dkg@fifthhorseman.net> + <1449718786-28000-7-git-send-email-dkg@fifthhorseman.net> + <566B4BCC.7060203@imca-cat.org> +User-Agent: Notmuch/0.21 (http://notmuchmail.org) Emacs/24.5.1 + (x86_64-pc-linux-gnu) +Date: Fri, 11 Dec 2015 17:22:08 -0500 +Message-ID: <87poycfwxb.fsf@alice.fifthhorseman.net> +MIME-Version: 1.0 +Content-Type: text/plain +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.20 +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: Fri, 11 Dec 2015 22:22:13 -0000 + +On Fri 2015-12-11 17:18:52 -0500, J. Lewis Muir wrote: +> On 12/11/15 3:56 PM, Tomi Ollila wrote: +>>> +static const char* +>>> +_notmuch_database_get_gpg_path (notmuch_database_t *notmuch) +>>> +{ +>>> +#define try_gpg_path(z) if (!access(z, X_OK)) return z +>>> + try_gpg_path("/usr/bin/gpg2"); +>>> + try_gpg_path("/bin/gpg2"); +>>> + try_gpg_path("/usr/bin/gpg"); +>>> + try_gpg_path("/bin/gpg"); +>>> + return NULL; +>>> +} +>> +>> If this were to survive longer, BSD folks would like to have +>> /usr/local/bin checked... +>> (i don't know (yet) about os x +> +> I'm not following closely, but seeing paths to programs hard coded in +> the source never seems like a good idea; invariably someone will have +> the program in an unanticipated location. I'm using pkgsrc on OS X, +> and my gpg is at /opt/pkg/bin/gpg. How about a Notmuch configuration +> file item specifying the location of the program? Or if not that, how +> about a configuration option at build time to specify the location of +> gpg that then gets hard coded in the source? Or if not that, how about +> an environment variable that will specify the location of the program +> (e.g. like OpenSSH's SSH_ASKPASS environment variable)? + +Yes, the path search is genericized later in the series (7/9). clearly +i should have done even more commit squashing to avoid confusing people +with this distraction. point clearly taken, though; i will avoid +hard-coding any paths. thanks! + + --dkg -- 2.26.2