Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / f6 / 43f9571fbfc7a30e75fd5afafdb931cd52ac9a
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 C22316DE0AC2\r
6  for <notmuch@notmuchmail.org>; Sat, 12 Dec 2015 15:25:07 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0.696\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.696 tagged_above=-999 required=5 tests=[AWL=0.044, \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 ynT4wIKu_b6B for <notmuch@notmuchmail.org>;\r
16  Sat, 12 Dec 2015 15:25:05 -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 2E69E6DE005F\r
19  for <notmuch@notmuchmail.org>; Sat, 12 Dec 2015 15:25:04 -0800 (PST)\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
21  by guru.guru-group.fi (Postfix) with ESMTP id 9C9FB10004A;\r
22  Sun, 13 Dec 2015 01:25:18 +0200 (EET)\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>\r
24 To: Daniel Kahn Gillmor <dkg@fifthhorseman.net>,\r
25  Notmuch Mail <notmuch@notmuchmail.org>\r
26 Subject: Re: [PATCH 7/9] add a gpg_path value for notmuch_database_t\r
27 In-Reply-To: <87mvtgfws4.fsf@alice.fifthhorseman.net>\r
28 References: <1449718786-28000-1-git-send-email-dkg@fifthhorseman.net>\r
29  <1449718786-28000-8-git-send-email-dkg@fifthhorseman.net>\r
30  <m21tas7ifa.fsf@guru.guru-group.fi> <87mvtgfws4.fsf@alice.fifthhorseman.net>\r
31 User-Agent: Notmuch/0.21+32~g73439f8 (http://notmuchmail.org) Emacs/24.3.1\r
32  (x86_64-unknown-linux-gnu)\r
33 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
34  $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
35  !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
36 Date: Sun, 13 Dec 2015 01:25:17 +0200\r
37 Message-ID: <m2fuz75jxe.fsf@guru.guru-group.fi>\r
38 MIME-Version: 1.0\r
39 Content-Type: text/plain; charset=utf-8\r
40 Content-Transfer-Encoding: quoted-printable\r
41 X-BeenThere: notmuch@notmuchmail.org\r
42 X-Mailman-Version: 2.1.20\r
43 Precedence: list\r
44 List-Id: "Use and development of the notmuch mail system."\r
45  <notmuch.notmuchmail.org>\r
46 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
47  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
48 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
49 List-Post: <mailto:notmuch@notmuchmail.org>\r
50 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
51 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
52  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
53 X-List-Received-Date: Sat, 12 Dec 2015 23:25:07 -0000\r
54 \r
55 On Sat, Dec 12 2015, Daniel Kahn Gillmor <dkg@fifthhorseman.net> wrote:\r
56 \r
57 > On Fri 2015-12-11 17:02:33 -0500, Tomi Ollila wrote:\r
58 >> The above code finds gpg/gpg2 (when called w/ these args) from\r
59 >> _CS_PATH (seems to be /bin:/usr/bin by default in linux (tried to\r
60 >> look how this set in *BSD -- initially it looks like /usr/local/bin\r
61 >> not included but... maybe we let them to complain if this is the case\r
62 >> ... :/)\r
63 >> ... anyway, the full found path is not set anywhere -- how is it found\r
64 >> when used (exec*p() using $PATH? :O)\r
65 >\r
66 > Hm, according to exec(3):\r
67 >\r
68 >    Special semantics for execlp() and execvp()\r
69 >        The execlp(), execvp(), and execvpe() functions duplicate the\r
70 >        actions of the shell in searching for an executable file if the\r
71 >        specified filename does not contain a slash (/) character.  The\r
72 >        file is sought in the colon-separated list of directory pathnames\r
73 >        specified in the PATH environment variable.  If this variable\r
74 >        isn't defined, the path list defaults to the current directory\r
75 >        followed by the list of directories returned by\r
76 >        confstr(_CS_PATH).  (This confstr(3) call typically returns the\r
77 >        value "/bin:/usr/bin".)\r
78 >\r
79 > So this code probably also ought to be searching $PATH as well.  yuck.\r
80 > You'd think there would be a commonly-available function for doing this\r
81 > specific check without having to actually try to exec() something.\r
82 \r
83 Indeed.\r
84 \r
85 Shells seems to be smart and do pre-check through PATH (but not=20\r
86 _CS_PATH...(**)) and then exec just with the found path. I straced\r
87 one execlp() usage and it na=C3=AFvely attempted to execve() through the\r
88 name appended to path (if getting ENOENT); when execve() succeeds\r
89 it does not return...\r
90 \r
91 I originally had a fast thought that it was a security feature not\r
92 use PATH (which user can screw up ;/), but some safer path set.\r
93 Perhaps that is not necessary...\r
94 \r
95 Perhaps the search should go through PATH if it is defined and\r
96 if not defined then use confstr(_CS_PATH). If PATH is empty\r
97 then not use confstr (but use current dir !!11!!?++?+?? (*))\r
98 \r
99 One thing I forgot from the review:\r
100 \r
101 the #define try_gpg_path(z) is done inside {}:s, so\r
102 before closing } there could be\r
103 #undef try_gpg_path (to make the "liveness" of it match the scope)\r
104 \r
105 \r
106 (*) what is the yuckiness of this:\r
107 \r
108   $ PATH=3D ls\r
109   zsh: command not found: ls\r
110 \r
111   $ bash -c 'PATH=3D ls'\r
112   bash: ls: No such file or directory\r
113 \r
114   $ echo '#!/bin/echo this is ./ls ?' >! ./ls\r
115   $ chmod 755 ./ls\r
116 \r
117   $ PATH=3D ls\r
118   this is ./ls ? ls -F\r
119 \r
120   $ PATH=3D command ls\r
121   this is ./ls ? ls\r
122 \r
123   $ bash -c 'PATH=3D ls'\r
124   this is ./ls ? ls\r
125 \r
126   $ rm ./ls\r
127 \r
128 (**) unset PATH had the same effect in bash and dash but zsh did not=20\r
129      check ./ls after 'unset PATH'\r
130 \r
131 -- I personally think we could just ignore empty components in PATH\r
132 (being it like PATH=3D, PATH=3D:/path/to, PATH=3D/path/to: and finally\r
133 PATH=3D/path/to::/path/to) (or then not, just be as compliant (and stupid)\r
134 as the PATH handling is).\r
135 \r
136 Tomi\r
137 \r
138 >\r
139 >          --dkg\r