aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/gist/gistxlog.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2014-04-04 22:03:38 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2014-04-04 22:03:38 -0400
commit7d1a0f585c233e0e316d99667f97f7af80069837 (patch)
treec9a8cd0044c2f3d98347c51cbadb2f074c467879 /src/backend/access/gist/gistxlog.c
parent598f3033f3b887b67acd7310175278732b4c27f9 (diff)
downloadpostgresql-7d1a0f585c233e0e316d99667f97f7af80069837.tar.gz
postgresql-7d1a0f585c233e0e316d99667f97f7af80069837.zip
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
Diffstat (limited to 'src/backend/access/gist/gistxlog.c')
0 files changed, 0 insertions, 0 deletions