Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i7HNJ-0004qr-HS for pgsql-general@arkaria.postgresql.org; Mon, 09 Sep 2019 10:58:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1i7HNI-0007V3-3q for pgsql-general@arkaria.postgresql.org; Mon, 09 Sep 2019 10:58:24 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i7HNH-0007Uv-QK for pgsql-general@lists.postgresql.org; Mon, 09 Sep 2019 10:58:23 +0000 Received: from mail.hjp.at ([212.17.106.138] helo=rorschach.hjp.at) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i7HNA-0004l5-4m for pgsql-general@lists.postgresql.org; Mon, 09 Sep 2019 10:58:23 +0000 Received: by rorschach.hjp.at (Postfix, from userid 1000) id 30E9C7B1; Mon, 9 Sep 2019 12:58:14 +0200 (CEST) Date: Mon, 9 Sep 2019 12:58:14 +0200 From: "Peter J. Holzer" To: pgsql-general@lists.postgresql.org Subject: Permissions on postgresql.conf, psql and patroni Message-ID: <20190909105814.GB11736@hjp.at> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="3lcZGd9BuhuYXNfi" Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --3lcZGd9BuhuYXNfi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 --=20 _ | 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 --3lcZGd9BuhuYXNfi Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAl12MEAACgkQ8g5IURL+ KF31Lw/8CQZcfo3K5lL0zsSVzuFEek9v5juhJAq6ZoSVXA18lkcpQG/aSYmrxsMh 9jmkbofzH9JruDoPoRjlrDj0qnJH8gOsesbclTfKnOwdA/McvnAt6EZaWTWknYUy MwAzWnmhTzBU5FdYm187hRaBxYb2oKDZRY5PqtnzVR7h64KTK+N5YrV/iXYi0lzJ 4UFu4UlefEl3akLtd5T1GSzmc/f3oueEUazGqhw2hK7kBp8TY/KtIkjA6kSVa0fZ FuYlnW1zVO/7XSbLd2Rz2sTD2I1iQXBlA/pgdcF6T+9R7drqd81i0RlGCG0NBNzO wMMt5Qkb0gARyAzehz2wB0ayHYPCKlfVhOMLHXVsciDKjPOkDpYH+HJ4/JF881jT NL8mMnXO9s3542KCY4mL+MhxnSZfmFNpScoY/xagDWKpXoZYRkrWy0wavGVkYT8z S+512YomNQAhMZ98R6n0m4czV4pCWSI7BDIVtYDtzHZhQzXbnTZnsxnNJ1fricyq geqeMqrUjlStpCma/BKdWTxrd1KnUQUtaaDOfEALzs9ZtSRfzObSPN7ewUZLSSDG kzC0Qh3PefHo2MtmWHPDbfCZdpqo0L4CL7/kWL4vsno8nEMDPAmZqJGPq7uH1Pzw Z2VgrIkatR53LALMs5NvDXBFnrr5iQyw43DptK1hX1KJcTejnmQ= =Yl/k -----END PGP SIGNATURE----- --3lcZGd9BuhuYXNfi--