From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8059 invoked by alias); 9 Oct 2019 16:43:13 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 8051 invoked by uid 89); 9 Oct 2019 16:43:13 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-5.1 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1602 X-HELO: NAM03-CO1-obe.outbound.protection.outlook.com Received: from mail-eopbgr790102.outbound.protection.outlook.com (HELO NAM03-CO1-obe.outbound.protection.outlook.com) (40.107.79.102) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 09 Oct 2019 16:43:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eTTEqQAosT2dgj4AJdlzL8B1djqzBFmFQqponTSZ1FkwH3IOjkGGa0GJNl5l85uf4JA+bdHP0fjJiD+arKErqcrDhiWxSljXOafzpr7r3GT0zh7hYgPo2tU5niaxEEIiFVlUvgU+h7Afah0YjAQ2FISPkDoS2GSJ0DsKWySOJAtMgbq/ARfD6nQWXMwPlVVi2f/bhQYgnexPrEi0ulo+4LZTsecZY2/AjKFJOzM7ZqwHy4XuTA98nZCvw/TJdiRQJzDgC5qF2FVaNuv+xjBnb9Ag1uGbwbPbdc9cHSGwuqskXsQXfhg5ZLrHWoz1drt9bXAJTVHtp7JxG496/EhJSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oiYYoeOeHoHxMDnjoONTPdLgnmOsByBYDilj9JIPsg8=; b=gnptmf7cWnx0Ou+qNUichGrV0/onS28PDoGxqNQl2bdAh/UbW6yIfVSl29U947LKw2TNnsIP83By8TM//CJMHa9c99cIZbbd1G14p5/41+eSRIpcAj8lTd4cLX4PvcK9N0BDMRr6NFw4KoSrL/bZwWmyAfgtudU/C6gZJPrFbiqXlGxVJsvFy9khDceL6R6Vz4woHeSn0qWME/qyFhlo/qCs7oO7czrs941XR1fUEsRckv44gNzwiqVNvBBtNC3eYlVBHI/nGDuUvOWOpaDJ01XlVbnv45zUNqKa88WiGWugIxKmMTtmLtcO4hC005OB09s6VO3xRD5Hnl3geKwmDw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cornell.edu; dmarc=pass action=none header.from=cornell.edu; dkim=pass header.d=cornell.edu; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cornell.edu; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oiYYoeOeHoHxMDnjoONTPdLgnmOsByBYDilj9JIPsg8=; b=GGY8HEQOtGQQW8zo4PrXspVNddHYFicrv8FMbuJv8kaWPbgUp0j/g+0rIXDJiYgYDI/bSWxXE1uJunscVsNDlvi4sxJXgyCrx8+nz5eDQrvNZW71EuM5wV/tLg+XV+0voDJKuwBMHa3B43bfesNWzD5xzlFTGJhA6JFXxdQlAKA= Received: from DM6PR04MB5738.namprd04.prod.outlook.com (20.179.51.81) by DM6PR04MB5467.namprd04.prod.outlook.com (20.178.27.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.16; Wed, 9 Oct 2019 16:43:08 +0000 Received: from DM6PR04MB5738.namprd04.prod.outlook.com ([fe80::6998:197f:bcff:7172]) by DM6PR04MB5738.namprd04.prod.outlook.com ([fe80::6998:197f:bcff:7172%4]) with mapi id 15.20.2327.023; Wed, 9 Oct 2019 16:43:08 +0000 From: Ken Brown To: "cygwin@cygwin.com" Subject: Re: execvp* and spawnvp* react differently to same PATH environment variable Date: Wed, 09 Oct 2019 16:43:00 -0000 Message-ID: References: <1549599310.1980812.1570481495155.JavaMail.zimbra@tdcadsl.dk> In-Reply-To: <1549599310.1980812.1570481495155.JavaMail.zimbra@tdcadsl.dk> user-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 authentication-results: spf=none (sender IP is ) smtp.mailfrom=kbrown@cornell.edu; x-ms-oob-tlc-oobclassifiers: OLM:1775; received-spf: None (protection.outlook.com: cornell.edu does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="Windows-1252" Content-ID: <3A35FB5557181241A9F375984157E956@namprd04.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 7om4vAUc8UIm1NnZ+0rsNb8X5c+daqXevgu71wFcLHShGbsWYNFR1jAT45A8aPAQbKiwa1Z+RtQJVh79gBZvcw== X-IsSubscribed: yes X-SW-Source: 2019-10/txt/msg00045.txt.bz2 On 10/7/2019 4:51 PM, donpedro.tdcadsl.dk via cygwin wrote: > Hi all, >=20 > While working on something i noticed that execvp* and spawnvp* behave dif= ferently with regards to $PATH, which i think is not correct. >=20 > ---------------------------------------------- >=20 > 1) The execvp* functions are called like this: >=20 > return spawnve ( _P_OVERLAY | _P_PATH_TYPE_EXEC , > find_exec ( file , buf , "PATH" , FE_NNF ) ? : "" , > argv , envp ); >=20 > This calls find_exec() with FE_NNF, which causes the path to be NULL if n= ot found in $PATH. >=20 > This later causes cygwin to fail correctly if the program is not in $PATH. >=20 > ---------------------------------------------- >=20 > 2) The spawnvp* functions are called like this: >=20 > return spawnve (mode | _P_PATH_TYPE_EXEC, find_exec (file, buf), argv, cu= r_environ ()); >=20 > This does _not_ calls find_exec() with FE_NNF which causes the path to be= the posix form, as it is not found in path. >=20 > This later causes cygwin to find the program even though it was not in $P= ATH which seems wrong. >=20 > ---------------------------------------------- >=20 > This seems like a bug in spawnvp* functions unless i am missing something? I think you're probably right. The use of FE_NNF in execvp* was introduced= in=20 commit 6d63272b. I suspect it was just an oversight that the spawvp* funct= ions=20 weren't changed in the same way. I'll send a patch to the cygwin-patches l= ist=20 to fix this. When Corinna returns, she can tell us whether there's some re= ason=20 that spawnvp should be different from execvp. Ken -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple