Permissions on postgresql.conf, psql and patroni - Mailing list pgsql-general

From Peter J. Holzer
Subject Permissions on postgresql.conf, psql and patroni
Date
Msg-id 20190909105814.GB11736@hjp.at
Whole thread Raw
Responses Re: Permissions on postgresql.conf, psql and patroni
Re: Permissions on postgresql.conf, psql and patroni
List 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@hjp.at         | management tools.
__/   | http://www.hjp.at/ | -- Ross Anderson <https://www.edge.org/>

Attachment

pgsql-general by date:

Previous
From: Achilleas Mantzios
Date:
Subject: Re: pgbouncer with ldap
Next
From: "Daniel Verite"
Date:
Subject: Re: Permissions on postgresql.conf, psql and patroni