Re: [PATCH 2/2] connect: improve check for plink to reduce false positives
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Apr 24, 2015, 06:41 UTC
- Message-ID
- <92bcca820a7ade286142458148d27bf3@www.dscho.org>
- In-Reply-To
- <20150423231403.GC274681@vauxhall.crustytoothpaste.net>
Hi Brian,
On 2015-04-24 01:14, brian m. carlson wrote:
Show 23 quoted lines
> On Thu, Apr 23, 2015 at 11:53:04AM -0400, Jeff King wrote: > >> If I were writing from scratch, I would probably keep things as tight as >> possible, like: >> >> const char *base = basename(ssh); >> plink = !strcasecmp(base, "plink") || >> !strcasecmp(base, "plink.exe"); >> tplink = !strcasecmp(base, "tortoiseplink") || >> !strcasecmp(base, "tortoiseplink.exe")); >> >> but maybe that is too tight at this point in time; we don't really know >> what's out there and working (or maybe _we_ do, but _I_ do not :) ). >> >> At any rate, brian's patch only looks for a dir-separator anywhere, not >> the actual basename. So: >> >> /path/to/plink/ssh >> >> would match, and I'm not sure if that's a good thing or not. > > This is true. In hindsight, I think it's probably better to be a bit > stricter, so I'll reroll to use the stricter format.
Thank you so much! Dscho