delorie.com/archives/browse.cgi | search |
X-Recipient: | archive-cygwin AT delorie DOT com |
DomainKey-Signature: | a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id |
:list-unsubscribe:list-subscribe:list-archive:list-post | |
:list-help:sender:date:from:to:subject:message-id:reply-to | |
:references:mime-version:content-type:in-reply-to; q=dns; s= | |
default; b=X6BdKh+GC36JrDPN+yV4C9TniIlnSmTTRH9LcMSqkY9dVyqkPAjg1 | |
Qe6g+/sH3f/fXHGkGktmf+BIEm0aRCI8dNR351SgcUg+bAuDMcEm80CInKp5acLx | |
yLm73uslGu4/MkgNrBl0pzA6RbkRrjDSu0DfAwcYNsZH9O1H0iyHQU= | |
DKIM-Signature: | v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id |
:list-unsubscribe:list-subscribe:list-archive:list-post | |
:list-help:sender:date:from:to:subject:message-id:reply-to | |
:references:mime-version:content-type:in-reply-to; s=default; | |
bh=twP2qHSRBaAH+iloX+zsBv33dlk=; b=K218JQJbndourbMSMlLAAp2GbsRB | |
CLBSbD7rKqP60AR7sqgo9k/UZ9bzdtXUv2Leb1vOiyXUb0Xub87DdBHefmVgYvff | |
lxX4qxXx46tOjqdYN1U03qRcC+e7HzNwpcRmZ76p9xTQO6YVUniH13WlEQdx5DGm | |
nrA0/p6hYdNz8Fo= | |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Id: | <cygwin.cygwin.com> |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sourceware.org/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
Authentication-Results: | sourceware.org; auth=none |
X-Virus-Found: | No |
X-Spam-SWARE-Status: | No, score=-5.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 |
X-HELO: | calimero.vinschen.de |
Date: | Wed, 11 Feb 2015 14:28:10 +0100 |
From: | Corinna Vinschen <corinna-cygwin AT cygwin DOT com> |
To: | cygwin AT cygwin DOT com |
Subject: | Re: execlp/execvp needs case-correct PATH |
Message-ID: | <20150211132810.GI7818@calimero.vinschen.de> |
Reply-To: | cygwin AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
References: | <54D7EB8E DOT 8070308 AT towo DOT net> <20150209101747 DOT GA12131 AT calimero DOT vinschen DOT de> <54D91D54 DOT 5000705 AT towo DOT net> <20150210092756 DOT GC15989 AT calimero DOT vinschen DOT de> <54DA5890 DOT 8060609 AT towo DOT net> |
MIME-Version: | 1.0 |
In-Reply-To: | <54DA5890.8060609@towo.net> |
User-Agent: | Mutt/1.5.23 (2014-03-12) |
--w2JjAQZceEVGylhD Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Feb 10 20:14, Thomas Wolff wrote: > Am 10.02.2015 um 10:27 schrieb Corinna Vinschen: > >On Feb 9 21:49, Thomas Wolff wrote: > >>Am 09.02.2015 um 11:17 schrieb Corinna Vinschen: > >>>On Feb 9 00:04, Thomas Wolff wrote: > >>>>With a Windows case sensitive file system (and according mount flags > >>>>for /cygdrive), the PATH does not properly reflect casing of the actu= al > >>>>directories (e.g. C:\WINDOWS vs. C:\Windows, thanks MS...). > >>>>However, the shell finds programs anyway, like e.g. notepad. > >>>>The exec*p system calls, on the other hand, do not find a program in = this > >>>>case as demonstrated by the attached test program. > >>>>This is in contrast to the Linux (and POSIX?) manual page which claims > >>>>=E2=80=9EThe execlp(), execvp(), and execvpe() functions duplicate th= e actions > >>>>of the shell in searching for an executable file =E2=80=A6=E2=80=9C > >>>... > >>Sorry, I forgot one detail: I added /cygdrive/c/Windows/System32 to my = path > >>so the shell will find it, but yet execlp does not find it. > >Which makes sense, given that notepad is not in C:\Windows\System32, but= in C:\Windows. > On my systems (Windows 7 Professional/Ultimate) it=E2=80=99s in both C:\W= indows and > C:\Windows\System32 > (otherwise the shell wouldn=E2=80=99t have found it after adding to the p= ath). >=20 > However, I could resolve the issue partly by putting > /cygdrive/c/Windows (or ../System32) in the path *before* the bogus > /cygdrive/c/WINDOWS - weird, but this way exec*p works. >=20 > With the old setting (bogus first in path), apparently/assumedly exec*p > somehow finds the file in /cygdrive/c/WINDOWS but then cannot start it fr= om > there because of the case mis-match. > There=E2=80=99s still the inconsistency with shell behaviour. I found the cause. The function searching for executables in $PATH was searching on the Win32 PATH variable. The underlying conversion functionality treats Win32 paths with default flags. I revamped the search function to iterate over the POSIX PATH variable so the posix=3D[0|1] mount flag is taken into account. As a nice side effect, the search function is mow much simpler and easier to understand. I tested this new stuff in a variety of situations, but there's still the chance that I missed something. So this needs a good, sturdy testing. I just uploaded new snapshots to the usual place: https://cygwin.com/snapshots/ Please give it a try. Thanks, Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --w2JjAQZceEVGylhD Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJU21jqAAoJEPU2Bp2uRE+gL5gP+gOQPn6gHpBlMk1uCRwLWrT0 8ZcPdFf7jqDYzHL2PbAGVsVmwD9MivGsh4i9aove6lkrldxMfD35lZLMNlknLgQ7 Vfev5AriKXgRsx68MqNBPaPFt0ZgxNE90sNF7IZa3n106Goio3H9bXl4eEayXngJ 2A6ItCLmyWGHHgc5071uLUM2c1ZLN9ze5g7pcAM5LAu2NDv1BnHV0TzBF9x/8DeF jilQ2O26tTNC/dKjhI4If12m2Sp8majiIhRRIgUBSvVSZPjUXtsa3HiZreq5R8gR o06miYd5820Ae6d0lLA5p8jzkXEl53diS4TIQUN5wMgqMBTkQ99LMBJfHCGt2Kce LuZGCq6tZsn1CKYXJra1+mGRj9M4pz6YHpSR3VXQOSvh4FQAXpO/Hv/SXLL0WVVU s6ng0gPa9HHhVN/8tEbKAXopHEAS1zqmamtmiEztKydXyJbqGoBIvEck5Bsl4Mje ddBKj397YvtnCSwT9+PAO8rLDyhByvEU2wqhKU1S3W+alnLdva8Y7ApdYt2mWHT8 0Ox/qBT5b1zadM6+nUbKRVm1ayOKqsrwo0A6ITeH0HZHpKOMTPYDKGdRunMezIoY Gh7JEqEbY/tb79O+vgB/kGJvxRI790JxELG19pBPBgqRrocGhbmsS4KllfpXIfti 04x+QpoZfrklsASQom74 =On95 -----END PGP SIGNATURE----- --w2JjAQZceEVGylhD--
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |