1 Return-Path: <tomi.ollila@iki.fi>
\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 arlo.cworth.org (Postfix) with ESMTP id 755C26DE0AC2
\r
6 for <notmuch@notmuchmail.org>; Sun, 13 Dec 2015 02:59:56 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org
\r
11 X-Spam-Status: No, score=0.694 tagged_above=-999 required=5 tests=[AWL=0.042,
\r
12 SPF_NEUTRAL=0.652] autolearn=disabled
\r
13 Received: from arlo.cworth.org ([127.0.0.1])
\r
14 by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id ccBCwunNNqe2 for <notmuch@notmuchmail.org>;
\r
16 Sun, 13 Dec 2015 02:59:54 -0800 (PST)
\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])
\r
18 by arlo.cworth.org (Postfix) with ESMTP id 4BEDD6DE005F
\r
19 for <notmuch@notmuchmail.org>; Sun, 13 Dec 2015 02:59:53 -0800 (PST)
\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])
\r
21 by guru.guru-group.fi (Postfix) with ESMTP id BCE9D10005A;
\r
22 Sun, 13 Dec 2015 13:00:05 +0200 (EET)
\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>
\r
24 To: David Bremner <david@tethera.net>,
\r
25 Daniel Kahn Gillmor <dkg@fifthhorseman.net>,
\r
26 Notmuch Mail <notmuch@notmuchmail.org>
\r
27 Subject: Re: [PATCH 7/9] add a gpg_path value for notmuch_database_t
\r
28 In-Reply-To: <87d1ubdu0k.fsf@zancas.localnet>
\r
29 References: <1449718786-28000-1-git-send-email-dkg@fifthhorseman.net>
\r
30 <1449718786-28000-8-git-send-email-dkg@fifthhorseman.net>
\r
31 <m21tas7ifa.fsf@guru.guru-group.fi> <87mvtgfws4.fsf@alice.fifthhorseman.net>
\r
32 <87d1ubdu0k.fsf@zancas.localnet>
\r
33 User-Agent: Notmuch/0.21+32~g73439f8 (http://notmuchmail.org) Emacs/24.3.1
\r
34 (x86_64-unknown-linux-gnu)
\r
35 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL
\r
36 $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F
\r
37 !)g;OY^,BjTbr)Np:%c_o'jj,Z
\r
38 Date: Sun, 13 Dec 2015 13:00:05 +0200
\r
39 Message-ID: <m24mfmbolm.fsf@guru.guru-group.fi>
\r
41 Content-Type: text/plain
\r
42 X-BeenThere: notmuch@notmuchmail.org
\r
43 X-Mailman-Version: 2.1.20
\r
45 List-Id: "Use and development of the notmuch mail system."
\r
46 <notmuch.notmuchmail.org>
\r
47 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,
\r
48 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
49 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>
\r
50 List-Post: <mailto:notmuch@notmuchmail.org>
\r
51 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
52 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,
\r
53 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
54 X-List-Received-Date: Sun, 13 Dec 2015 10:59:56 -0000
\r
56 On Sun, Dec 13 2015, David Bremner <david@tethera.net> wrote:
\r
58 > Daniel Kahn Gillmor <dkg@fifthhorseman.net> writes:
\r
60 >> On Fri 2015-12-11 17:02:33 -0500, Tomi Ollila wrote:
\r
61 >>> The above code finds gpg/gpg2 (when called w/ these args) from
\r
62 >>> _CS_PATH (seems to be /bin:/usr/bin by default in linux (tried to
\r
63 >>> look how this set in *BSD -- initially it looks like /usr/local/bin
\r
64 >>> not included but... maybe we let them to complain if this is the case
\r
66 >>> ... anyway, the full found path is not set anywhere -- how is it found
\r
67 >>> when used (exec*p() using $PATH? :O)
\r
69 >> Hm, according to exec(3):
\r
71 >> Special semantics for execlp() and execvp()
\r
72 >> The execlp(), execvp(), and execvpe() functions duplicate the
\r
73 >> actions of the shell in searching for an executable file if the
\r
74 >> specified filename does not contain a slash (/) character. The
\r
75 >> file is sought in the colon-separated list of directory pathnames
\r
76 >> specified in the PATH environment variable. If this variable
\r
77 >> isn't defined, the path list defaults to the current directory
\r
78 >> followed by the list of directories returned by
\r
79 >> confstr(_CS_PATH). (This confstr(3) call typically returns the
\r
80 >> value "/bin:/usr/bin".)
\r
82 >> So this code probably also ought to be searching $PATH as well. yuck.
\r
83 >> You'd think there would be a commonly-available function for doing this
\r
84 >> specific check without having to actually try to exec() something.
\r
86 > Without weighing in on the advisibility of searching for gpg in $PATH,
\r
87 > there is a glib function g_find_program_in_path. We're already linking
\r
88 > to glib (because of gmime mainly, but it's used other places as well).
\r
90 glib2-2.38 (glib/gutils.c) seems to look in PATH, and if
\r
91 g_getenv ("PATH") == NULL uses hardcoded path "/bin:/usr/bin:.";
\r
92 (it us "security" feature to have '.' last...)
\r
94 If rest is TL;DR; I'd suggest we use this... since libgpgme has implemented
\r
95 it IMO too late for use in 2016 (or do additional compat function?)
\r
97 > The other point that occurs to me is that libgpgme solves this same
\r
98 > problem in src/posix-util.c. It also seems to search path, at least
\r
99 > optionally, although only if it cannot find gpgconf.
\r
101 On Fedora 20 I looked gpgme-1.3.2 sources -- in there I could not find
\r
102 this search using PATH... gpg-1.3.2 is released 2012-05-02...
\r
104 Jessie (lib)gpgme 1.5.1 (2014-07-30) seems to have the code David mentioned...
\r
105 (btw. I was suprisingly hard to search Debian packages; IIRC it was easier)
\r
107 Ubuntu 14.04 LTS has (lib)gpgme 1.4.3 (ubuntu5). I did not download that
\r
108 source... but 1.5.1 NEWS indicates that this PATH search has arrived to
\r
111 This search is different from glib2-version that if getenv("PATH") == NULL
\r
112 search only "/bin:/usr/bin"
\r