From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4448 invoked by alias); 7 Oct 2019 20:51:39 -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 4440 invoked by uid 89); 7 Oct 2019 20:51:39 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-0.7 required=5.0 tests=AWL,BAYES_00,KAM_ASCII_DIVIDERS,RCVD_IN_RP_RNBL,SPF_PASS autolearn=no version=3.3.1 spammy=H*F:D*dk X-HELO: outgoing-yousee-2.gl-mut-gbl.as8677.net Received: from outgoing-yousee-2.gl-mut-gbl.as8677.net (HELO outgoing-yousee-2.gl-mut-gbl.as8677.net) (193.201.76.62) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 07 Oct 2019 20:51:37 +0000 Received: from filter.yousee.as8677.net (localhost [10.98.98.50]) by mwumf0304.yousee.as8677.net (SMTP Server) with ESMTP id 46nCMC36Tzz3pD for ; Mon, 7 Oct 2019 22:51:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tdcadsl.dk; s=sela; t=1570481495; bh=cF8omoWnqgBKlswEmLf8o5r0GLj44rNWM3Y94obpcjE=; h=Date:From:To:Cc:Message-ID:Subject:MIME-Version:Content-Type: Content-Transfer-Encoding; b=nE3vzq4hSMS+qlxfk5L2IY1UWPjZOJoJfsDeEzFZu6Zms8ZX3P21MPqWHbUhnIgp9 Nyxg2gGTQDx2EJtOEijCZf6G/qjoh8y2cgVFEwpgQcIAuyz7Nvbe1W3rxFvzwqNKhl 6W+FV+W+HOr0qSO89KjQEzFZsWF6CIIZTRYF2wGPIfNgLL8ledrIERcMGMlNbRypOf bPFXaXA3sMr8QyMnnasq6UHIW31LYd5B8fdpz4zHTF2NkpVSkHY1oEBXWPZJUNVtr0 NWICHmT+UzobG8B+O43lIf5rpZX8sEE0sJIxhLatt4upm0AJ7eGgNL5lyFI/Oif82I piTRG7joUWFBg== Received: from myseb0113.sys.meshcore.net (myseb0113.sys.meshcore.net [10.98.98.50]) by mwumf0304.yousee.as8677.net (SMTP Server) with ESMTP id 46nCMC2bHbz3p7; Mon, 7 Oct 2019 22:51:35 +0200 (CEST) Received: from myseb0113.sys.meshcore.net (myseb0113.sys.meshcore.net [10.98.98.50]) by mwumf0304.yousee.as8677.net (SMTP Server) with ESMTP; Mon, 7 Oct 2019 22:51:35 +0200 (CEST) Date: Mon, 07 Oct 2019 20:51:00 -0000 From: "donpedro.tdcadsl.dk via cygwin" Reply-To: donpedro@tdcadsl.dk To: cygwin@cygwin.com Cc: pdtychsen.ext@gn.com Message-ID: <1549599310.1980812.1570481495155.JavaMail.zimbra@tdcadsl.dk> Subject: execvp* and spawnvp* react differently to same PATH environment variable MIME-Version: 1.0 X-yse-mailing: LEGIT X-yse-spamcause: OK, (0)(0000)gggruggvucftvghtrhhoucdtuddrgedufedrheejgddugedtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuvfffvedpggftfgfpufgfuefuveftkfeugfdpqfgfvfenuceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvkffugggtgfhithesthejtgdttddtjeenucfhrhhomhepughonhhpvggurhhosehtuggtrggushhlrdgukhenucfkphepuddtrdelkedrleekrdehtddpuddtrddutddtrddutddurdegudenucfrrghrrghmpehhvghlohepmhihshgvsgdtuddufedrshihshdrmhgvshhhtghorhgvrdhnvghtpdhinhgvthepuddtrdelkedrleekrdehtddpmhgrihhlfhhrohhmpeguohhnphgvughrohesthgutggrughslhdrughkpdhrtghpthhtoheptgihghifihhnsegthihgfihinhdrtghomhdprhgtphhtthhopehpughthigthhhsvghnrdgvgihtsehgnhdrtghomhenucevlhhushhtvghrufhiiigvpedt Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2019-10/txt/msg00032.txt.bz2 Hi all, While working on something i noticed that execvp* and spawnvp* behave differently with regards to $PATH, which i think is not correct. ---------------------------------------------- 1) The execvp* functions are called like this: return spawnve ( _P_OVERLAY | _P_PATH_TYPE_EXEC , find_exec ( file , buf , "PATH" , FE_NNF ) ? : "" , argv , envp ); This calls find_exec() with FE_NNF, which causes the path to be NULL if not found in $PATH. This later causes cygwin to fail correctly if the program is not in $PATH. ---------------------------------------------- 2) The spawnvp* functions are called like this: return spawnve (mode | _P_PATH_TYPE_EXEC, find_exec (file, buf), argv, cur_environ ()); 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. This later causes cygwin to find the program even though it was not in $PATH which seems wrong. ---------------------------------------------- This seems like a bug in spawnvp* functions unless i am missing something? Any thoughts? Thanks, /pedro -- 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