Prevent pg_ctl from being run as root. Since it uses configuration files

Tom Lane <tgl@sss.pgh.pa.us>

Commit: c58675b42886f7aa1d8871d4917d512c477ca402
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2004-10-22T00:24:18Z
Releases: 8.0.0
Prevent pg_ctl from being run as root.  Since it uses configuration files
owned by postgres, doing "pg_ctl start" as root could allow a privilege
escalation attack, as pointed out by iDEFENSE.  Of course the postmaster would
fail, but we ought to fail a little sooner to protect sysadmins unfamiliar
with Postgres.  The chosen fix is to disable root use of pg_ctl in all cases,
just to be confident there are no other holes.

Files

PathChange+/−
src/bin/pg_ctl/pg_ctl.c modified +20 −2