Re: pg_regress: lookup shellprog in $PATH - Mailing list pgsql-hackers

From Tom Lane
Subject Re: pg_regress: lookup shellprog in $PATH
Date
Msg-id 1321298.1661393664@sss.pgh.pa.us
Whole thread Raw
In response to pg_regress: lookup shellprog in $PATH  (Gurjeet Singh <gurjeet@singh.im>)
Responses Re: pg_regress: lookup shellprog in $PATH
List pgsql-hackers
Gurjeet Singh <gurjeet@singh.im> writes:
> Please see attached the one-letter patch that fixes this problem. I have
> chosen to replace the execl() call with execlp(), which performs a lookup
> in $PATH, and finds the 'sh' to use for running the postmaster.

I can't say that I think this is a great fix.  It creates security
questions that did not exist before, even without the point you
make about Windows considering execlp deprecated.

Given the lack of complaints about how pg_ctl works, I'd be inclined
to follow its lead and just hard-wire "/bin/sh", removing the whole
SHELLPROG/shellprog dance.  I have not heard of anyone using the
theoretical ability to compile pg_regress with some other value.

> The Nixpkgs and NixOS distro includes all the supported versions of
> Postgres, so one would assume they would've also encountered, and solved,
> this problem. But they didn't. My best guess as to why, is, I believe they
> never bothered to run `make check` on their built binaries.

TBH, it's not clear to me that that project is competent enough to
be something we should take into account.  But in any case, I'd
rather see us using fewer ways to do this, not more.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Justin Pryzby
Date:
Subject: Re: shadow variables - pg15 edition
Next
From: Tom Lane
Date:
Subject: Re: pg_regress: lookup shellprog in $PATH