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 1gk4jT-00034l-VT for pgsql-bugs@arkaria.postgresql.org; Thu, 17 Jan 2019 10:17:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gk4jS-0003CO-5N for pgsql-bugs@arkaria.postgresql.org; Thu, 17 Jan 2019 10:17:06 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gk4YR-0001t8-8W for pgsql-bugs@lists.postgresql.org; Thu, 17 Jan 2019 10:05:43 +0000 Received: from ulminfo.fr ([2001:41d0:8:c58b::]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gk4YN-0002Jg-Su for pgsql-bugs@lists.postgresql.org; Thu, 17 Jan 2019 10:05:41 +0000 Received: from zeta (unknown [IPv6:2a01:e34:ec05:d6e0:15b9:afb3:54c5:e0a8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ulminfo.fr (Postfix) with ESMTPSA id 104D0C1159; Thu, 17 Jan 2019 11:05:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=a3nm.net; s=default; t=1547719537; bh=ky1zViSXzzGQoTjsA5HxlPrE2ZqQnbXsghHK5Ykr/BM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KdCNcgfUawLy04XtYfP1gMWyuThXdD/g23x7hoEVGvxOk8VvUV8seiIkEiRLxwrIy TruEq7CZBclYK9OFbjzp3LMV2WMQDsHjnMTj54aUYE2jXhbWlT4fNsoYjTK0OW118a G/A/aGpCOap9KrFJdnMndsHxYXF9aLQZdirWZLPs= Date: Thu, 17 Jan 2019 11:05:36 +0100 From: Antoine Amarilli To: Tom Lane Cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15596: Folders created with wrong permissions when installing an extension with a non-default umask Message-ID: <20190117100536.2lrqobpvkj4clhsj@zeta> References: <15596-a7991ddfd29b90d0@postgresql.org> <3966.1547692421@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="siwfx7p7nf4gn3fl" Content-Disposition: inline In-Reply-To: <3966.1547692421@sss.pgh.pa.us> User-Agent: NeoMutt/20180716 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --siwfx7p7nf4gn3fl Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Tom, On Wed, Jan 16, 2019 at 09:33:41PM -0500, Tom Lane wrote: > =3D?utf-8?q?PG_Bug_reporting_form?=3D writes: > > However, the umask of my user is 077, so these "mkdir -p" invocations a= re > > creating folders that can only be read by root, which is not the intend= ed > > behavior. >=20 > So ... don't do that. Sure, when you've noticed the problem it's easy to work around it. But when you haven't noticed it, doing "make install" appears to work fine and then later things break in a confusing way because the files have been installed and only root can read them. This makes the install process quite counter-intuitive. > > Would it be possible to fix this by redefining MKDIR_P=3D"mkdir -m 0755= -p" in > > pgxs.mk so that the mkdir invocations create the folders with the right > > permissions, in line with the "install" invocations? Thanks! >=20 > I think that would be a pretty bad idea, because it would break things > for packagers who have their own ideas about what the directory > permissions ought to be. I see, but on the other hand all files are installed with "/usr/bin/install -c -m 755" or "/usr/bin/install -c -m 644". If you're deciding to make the files world-readable when installing them, why not decide the same thing for the new directories that you create? > You can, of course, enforce your own ideas on the make run with something > like (untested) >=20 > make MKDIR_P=3D"mkdir -m 0755 -p" install Sure, thanks! I'll suggest this to the extension maintainer in case it can't be fixed in Postgres. Best, --=20 Antoine Amarilli --siwfx7p7nf4gn3fl Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEOcjWpfrki1T9GCYxgNiLItQzAzEFAlxAU28ACgkQgNiLItQz AzGtVg//Vbr7Ch0iQ2IuJ8LdAEM2OZdEYfoFjd9WHaQiecSYsUYLSilmO0vabWAC 2nj7ZI1BEil/eeYaDkafbvbxqYgZV2EDp9ZHbYuwitMg9T3DKtPys8XKIwaKK8Xc j8C8dBB9GFpEC6QsAwdAleCRlOEd7+WoRfudwe1R6b8NenS/3lrcxuVmkA5xD2c9 rDNXqv+X7Rm21cDXK66esdteF5pwxm3Zq0NuIVDg3IiXjlmJT4wRhtB7PdNKDYxm e3J/b6fCZz+c0Pg6PRZDPwaIlvxrPyMbbyFbPL4ox7pLvTEcphJquIhozyUd24Kf FhV3bDpSILnXGwO1odZ6w3yedz7/pVvgSRY4d8Ol/CoXsvRFacP4CZU5tUUHni11 wyAHxhGkynLyPXs2veUV3f5jo4boont/pjsyvupjV5UyrYzFR72RJaB32U1sPQer i37K58LI7IZNWKlT4E6HBfYQNM8ar1djdR9cuxd7rzWP9iyZkKAPEJ0K7nVtyVBl CpvKnp6xngkU8dGDXLAmq6BJ99B7YRfMx0P/7hnkpW5+/aUGIbLBjDxafxgXl1xh FzyegPMurPDjIQl25wQOq4/Y60dUjogzheYUkEnij/V7NwEmbQcBvL/UMotqaQwx SS7r6OVGHneuzVQF7ThOmPLYHuRr3c3C9T3QBnLpaz0Ct7W0YCg= =vwt6 -----END PGP SIGNATURE----- --siwfx7p7nf4gn3fl--