pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Antoine Amarilli <a3nm.postgresql@a3nm.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15596: Folders created with wrong permissions when installing an extension with a non-default umask
Date: Thu, 17 Jan 2019 11:05:36 +0100
Message-ID: <20190117100536.2lrqobpvkj4clhsj@zeta> (raw)
In-Reply-To: <3966.1547692421@sss.pgh.pa.us>
References: <15596-a7991ddfd29b90d0@postgresql.org>
	<3966.1547692421@sss.pgh.pa.us>

Hi Tom,

On Wed, Jan 16, 2019 at 09:33:41PM -0500, Tom Lane wrote:
> =?utf-8?q?PG_Bug_reporting_form?= <noreply@postgresql.org> writes:
> > However, the umask of my user is 077, so these "mkdir -p" invocations are
> > creating folders that can only be read by root, which is not the intended
> > behavior.
> 
> 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="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!
> 
> 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)
> 
> 	make MKDIR_P="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,

-- 
Antoine Amarilli

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (3+ messages)

Message-ID: <20190117100536.2lrqobpvkj4clhsj@zeta>
Permalink:  ../20190117100536.2lrqobpvkj4clhsj@zeta/
Also on:    postgresql.org/message-id/20190117100536.2lrqobpvkj4clhsj@zeta

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: a3nm.postgresql@a3nm.net, tgl@sss.pgh.pa.us
  Subject: Re: BUG #15596: Folders created with wrong permissions when installing an extension with a non-default umask
  In-Reply-To: <20190117100536.2lrqobpvkj4clhsj@zeta>
  References: <15596-a7991ddfd29b90d0@postgresql.org> <3966.1547692421@sss.pgh.pa.us> <20190117100536.2lrqobpvkj4clhsj@zeta>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox