postgresql/src/bin
Tom Lane b203c57bb7 Allow "-C variable" and "--describe-config" even to root users.
There's no really compelling reason to refuse to do these read-only,
non-server-starting options as root, and there's at least one good
reason to allow -C: pg_ctl uses -C to find out the true data directory
location when pointed at a config-only directory.  On Windows, this is
done before dropping administrator privileges, which means that pg_ctl
fails for administrators if and only if a config-only layout is used.

Since the root-privilege check is done so early in startup, it's a bit
awkward to check for these switches.  Make the somewhat arbitrary
decision that we'll only skip the root check if -C is the first switch.
This is not just to make the code a bit simpler: it also guarantees that
we can't misinterpret a --boot mode switch.  (While AuxiliaryProcessMain
doesn't currently recognize any such switch, it might have one in the
future.)  This is no particular problem for pg_ctl, and since the whole
behavior is undocumented anyhow, it's not a documentation issue either.
(--describe-config only works as the first switch anyway, so this is
no restriction for that case either.)

Back-patch to 9.2 where pg_ctl first began to use -C.

MauMau, heavily edited by me
2014-04-04 22:03:35 -04:00
..
initdb Remove MinGW readdir/errno bug workaround fixed on 2003-10-10 2014-03-21 13:47:37 -04:00
pg_basebackup Remove MinGW readdir/errno bug workaround fixed on 2003-10-10 2014-03-21 13:47:37 -04:00
pg_config Update copyright for 2014 2014-01-07 16:05:30 -05:00
pg_controldata Update copyright for 2014 2014-01-07 16:05:30 -05:00
pg_ctl Allow "-C variable" and "--describe-config" even to root users. 2014-04-04 22:03:35 -04:00
pg_dump Fix some compiler warnings that clang emits with -pedantic. 2014-04-04 11:29:50 -04:00
pg_resetxlog Remove MinGW readdir/errno bug workaround fixed on 2003-10-10 2014-03-21 13:47:37 -04:00
pgevent Remove inappropriate EXPORTS line. 2014-02-19 21:08:50 -05:00
psql Fix some compiler warnings that clang emits with -pedantic. 2014-04-04 11:29:50 -04:00
scripts scripts: Remove newlines from end of generated SQL 2014-02-10 21:47:19 -05:00
Makefile Update copyright for 2014 2014-01-07 16:05:30 -05:00