Re: BUG #16080: pg_ctl is failed if a fake cmd.exe exist in thecurrent directory. - Mailing list pgsql-bugs

From Juan José Santamaría Flecha
Subject Re: BUG #16080: pg_ctl is failed if a fake cmd.exe exist in thecurrent directory.
Date
Msg-id CAC+AXB3Rj1KkQtLMGqpO5q9_+50Rzre_u4KZjXerX+kHfWsJ2A@mail.gmail.com
Whole thread Raw
In response to Re: BUG #16080: pg_ctl is failed if a fake cmd.exe exist in the current directory.  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #16080: pg_ctl is failed if a fake cmd.exe exist in the current directory.
List 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 

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #16080: pg_ctl is failed if a fake cmd.exe exist in the current directory.
Next
From: Tom Lane
Date:
Subject: Re: BUG #16080: pg_ctl is failed if a fake cmd.exe exist in the current directory.