Permissions on postgresql.conf, psql and patroni

From: "Peter J(dot) Holzer" <hjp-pgsql(at)hjp(dot)at>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Permissions on postgresql.conf, psql and patroni
Date: 2019-09-09 10:58:14
Message-ID: 20190909105814.GB11736@hjp.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Yesterday I "apt upgrade"d patroni (to version 1.6.0-1.pgdg18.04+1 from
http://apt.postgresql.org/pub/repos/apt bionic-pgdg/main).

Today I noticed that I couldn't invoke psql as an unprivileged user
anymore:

% psql
Error: Invalid data directory for cluster 11 main

Further investigation showed that the read permissions on
/etc/.../postgresql.conf were revoked at the time of the upgrade. Either
by a post-install script or maybe by patroni itself, when it started up
again.

This leads me to two questions:

1) Is there a reason to restrict read access to postgresql.conf to the
user postgres? AFAIK this file doesn't normally contain sensitive data
(unlike pg_hba.conf and pg_ident.conf which are restricted by default).

2) Why does psql need to read postgresql.conf, and more specifically,
why does it care about the location of the data directory? It
shouldn't access files directly, just talk to the server via the
socket.

hp

--
_ | Peter J. Holzer | we build much bigger, better disasters now
|_|_) | | because we have much more sophisticated
| | | hjp(at)hjp(dot)at | management tools.
__/ | http://www.hjp.at/ | -- Ross Anderson <https://www.edge.org/>

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Daniel Verite 2019-09-09 11:29:38 Re: Permissions on postgresql.conf, psql and patroni
Previous Message Achilleas Mantzios 2019-09-09 10:46:32 Re: pgbouncer with ldap