Re: [PATCH v4 01/16] add util/search-path.{c, h} to test for executables in $PATH
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Fri, 12 Aug 2016 06:19:06 +0000 (02:19 +2000)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 23:22:23 +0000 (16:22 -0700)
36/d82edeef35012b82b1d869a0167caad8d315e1 [new file with mode: 0644]

diff --git a/36/d82edeef35012b82b1d869a0167caad8d315e1 b/36/d82edeef35012b82b1d869a0167caad8d315e1
new file mode 100644 (file)
index 0000000..425b45a
--- /dev/null
@@ -0,0 +1,120 @@
+Return-Path: <dkg@fifthhorseman.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id E93896DE092C\r
+ for <notmuch@notmuchmail.org>; Thu, 11 Aug 2016 23:19:26 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.097\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.097 tagged_above=-999 required=5 tests=[AWL=0.097]\r
+ autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id c3NvNcsTpTXL for <notmuch@notmuchmail.org>;\r
+ Thu, 11 Aug 2016 23:19:18 -0700 (PDT)\r
+Received: from che.mayfirst.org (che.mayfirst.org [162.247.75.118])\r
+ by arlo.cworth.org (Postfix) with ESMTP id B2F106DE0926\r
+ for <notmuch@notmuchmail.org>; Thu, 11 Aug 2016 23:19:18 -0700 (PDT)\r
+Received: from fifthhorseman.net\r
+ (h-67-100-110-108.nycm.ny.dynamic.globalcapacity.com [67.100.110.108])\r
+ by che.mayfirst.org (Postfix) with ESMTPSA id A19F2F993;\r
+ Fri, 12 Aug 2016 02:19:14 -0400 (EDT)\r
+Received: by fifthhorseman.net (Postfix, from userid 1000)\r
+ id 43CE71FF38; Fri, 12 Aug 2016 02:19:09 -0400 (EDT)\r
+From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>\r
+To: David Bremner <david@tethera.net>, Notmuch Mail <notmuch@notmuchmail.org>\r
+Subject: Re: [PATCH v4 01/16] add util/search-path.{c,\r
+ h} to test for executables in $PATH\r
+In-Reply-To: <878tw2r0vf.fsf@maritornes.cs.unb.ca>\r
+References: <1467970047-8013-1-git-send-email-dkg@fifthhorseman.net>\r
+ <1467970047-8013-2-git-send-email-dkg@fifthhorseman.net>\r
+ <878tw2r0vf.fsf@maritornes.cs.unb.ca>\r
+User-Agent: Notmuch/0.22.1+88~g8d09e96 (https://notmuchmail.org) Emacs/24.5.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Fri, 12 Aug 2016 02:19:06 -0400\r
+Message-ID: <87k2fmse5h.fsf@alice.fifthhorseman.net>\r
+MIME-Version: 1.0\r
+Content-Type: multipart/signed; boundary="=-=-=";\r
+ micalg=pgp-sha512; protocol="application/pgp-signature"\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.20\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Fri, 12 Aug 2016 06:19:27 -0000\r
+\r
+--=-=-=\r
+Content-Type: text/plain\r
+\r
+On Fri 2016-08-12 01:51:16 -0400, David Bremner wrote:\r
+> Daniel Kahn Gillmor <dkg@fifthhorseman.net> writes:\r
+>\r
+>> This is a utility function we can use to see whether an executa>\r
+>> +    if (strchr (exename, '/')) {\r
+>> +   if (0 == access (exename, X_OK))\r
+>> +       return TRUE;\r
+>> +   else\r
+>> +       return FALSE;\r
+>> +    }\r
+>\r
+> Should we distinguish between relative and absolute paths here?  I can't\r
+> think of any security implications, but I'm wondering if a relative path\r
+> is likely just a user error.\r
+\r
+I don't think a relative path is necessarily a user error.  I certainly\r
+use relative paths myself from time to time.\r
+\r
+>> +   path = (char *) malloc (n);\r
+>> +   if (! path)\r
+>> +       return FALSE;\r
+>\r
+> I kindof hate hiding the error here, although I agree it's\r
+> unlikely. What about the unixy return 0 ok, 1 not found -1 error?\r
+>\r
+>> +   confstr (_CS_PATH, path, n);\r
+>> +    }\r
+>> +\r
+>> +    tok = strtok_r (path, ":", &save);\r
+>> +    while (tok) {\r
+>\r
+> I guess it's fine to modify path here, but another option is\r
+> strtok_len (in string-util.h)\r
+\r
+I'm ok with both of these changes -- do you want to propose a variant\r
+for this patch?\r
+\r
+thanks for going through and trying to get this stuff building again.\r
+\r
+    --dkg\r
+\r
+--=-=-=\r
+Content-Type: application/pgp-signature; name="signature.asc"\r
+\r
+-----BEGIN PGP SIGNATURE-----\r
+\r
+iQJ8BAEBCgBmBQJXrWpaXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w\r
+ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRFREIyRTc0RjU2RkNGMkI2NzI5N0I3MzUy\r
+NEVDRkY1QUZGNjgzNzBBAAoJECTs/1r/aDcKtUMQAIupcnhxWxYyhOf28kjjIGKX\r
+7Cf8KX5w40hfyhzipnILrKSl45TEea9E5ZNMKBiDs/vyQp1D9WLPR3shRfl+gWZC\r
+jhJdiECyLfJ6nf1QnW+zNusRPYNdInDLSLB5AggoCgvOyXd34Cg8GiXynf/I6NdZ\r
+kZqGjpdJAzV9MaDWOPjWJ2Sazwfu3CAjhLvRDCOLmtbPamHG16eOpno06uw5haPl\r
+ZrHVt1PeZLErHS17eSCMKeHEe0sbHSaX88cbebTuunkzvLCRh/MUaUkZ7or7KDaZ\r
+4ego7ZrVMMv6LbA1/h7Ao+TzFFO9GNKK7DeMHmRlHVSuKzD723Fzpd9hzHG+1MhU\r
+/nsRcZHo8mZjPbyZzaVjgTslQeM1cIxX1Oo1AW7D/67PAc+cNey6p+H78m54oPqY\r
+OUBqn5s1WqEdxLW6UvNaB5b8wYH1vMcBkkCeU/c95TIi6otR1wYKAWShMGTcjh1a\r
+DsB802JqCl3+MHM0jMt2NeWSNgwrseHNHD+iaDC8Laogr8iy6m7geymoBhvSR+QU\r
+l/Faxs0c5561yVuP2v/uFuY+SyT5OxpPCkNS/DN5bC5n5aObS6g3tnJvRagpcMDV\r
+xzVmI1t4pDjGlS/uQESaj5VWEwtRzz/M9V3du5LBWh8heORWu1zfO/H2Zy/UKrSX\r
+jf0kHVSo/66yizLiHwPJ\r
+=CnBc\r
+-----END PGP SIGNATURE-----\r
+--=-=-=--\r