Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iONrS-00087P-OI for pgsql-bugs@arkaria.postgresql.org; Sat, 26 Oct 2019 15:20:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iONrQ-0005HL-67 for pgsql-bugs@arkaria.postgresql.org; Sat, 26 Oct 2019 15:20:12 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iONrP-0005GW-RM for pgsql-bugs@lists.postgresql.org; Sat, 26 Oct 2019 15:20:11 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iONrM-0007o4-Un for pgsql-bugs@lists.postgresql.org; Sat, 26 Oct 2019 15:20:09 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x9QFK4Wo026129; Sat, 26 Oct 2019 11:20:04 -0400 From: Tom Lane To: =?UTF-8?Q?Juan_Jos=C3=A9_Santamar=C3=ADa_Flecha?= cc: cilizili@protonmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16080: pg_ctl is failed if a fake cmd.exe exist in the current directory. In-reply-to: References: <16080-5d7f03222469f717@postgresql.org> <22130.1572097001@sss.pgh.pa.us> Comments: In-reply-to =?UTF-8?Q?Juan_Jos=C3=A9_Santamar=C3=ADa_Flecha?= message dated "Sat, 26 Oct 2019 16:15:04 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <26127.1572103204.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sat, 26 Oct 2019 11:20:04 -0400 Message-ID: <26128.1572103204@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk =3D?UTF-8?Q?Juan_Jos=3DC3=3DA9_Santamar=3DC3=3DADa_Flecha?=3D writes: > There is a difference in the behaviour for the WIN32 port. In other > platforms execl() is called from "src/bin/pg_ctl/pc_ctl" with the full p= ath > ("/bin/sh"), but for WIN32 the function CreateProcessAsUser() calls the = CMD > command without a path, and this function has a search logic of its own = [1]. Right, but does cmd.exe have a well-defined location in Windows? I don't think we can know which drive it's on, for starters. Ultimately this seems like a problem of insecure search path, which is not our responsibility to fix (and people would not appreciate us trying, in many cases). regards, tom lane