Re: BUG #16080: pg_ctl is failed if a fake cmd.exe exist in the current directory.
Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>
From: Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: cilizili@protonmail.com, pgsql-bugs@lists.postgresql.org
Date: 2019-10-26T14:15:04Z
Lists: pgsql-bugs
On Sat, Oct 26, 2019 at 3:36 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> I do not think this is a bug. There are probably thousands of ways to
> break Postgres by misconfiguring your system, and this is one of 'em.
>
>
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 path
("/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].
If even this difference out is of any value I can propose a patch.
[1]
https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessasusera
Regards,
Juan José Santamaría Flecha
Commits
-
On Windows, use COMSPEC to find the location of cmd.exe.
- f88544904e4b 13.0 landed