Re: PATCH: Configurable file mode mask

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: David Steele <david(at)pgmasters(dot)net>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Stephen Frost <sfrost(at)snowman(dot)net>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Adam Brightwell <adam(dot)brightwell(at)crunchydata(dot)com>
Subject: Re: PATCH: Configurable file mode mask
Date: 2018-01-10 18:19:46
Message-ID: 20180110181946.zj5b3wxhor2mf27h@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

David Steele wrote:
> On 1/8/18 8:58 PM, Peter Eisentraut wrote:

> > Yeah, I didn't like this aspect when this patch was originally
> > submitted. We want to keep the code legible for future new
> > contributors. Having these generic-sounding but specific-in-purpose
> > wrapper functions can be pretty confusing. Let's use mkdir() when it's
> > the appropriate function, and let's figure out a different name for
> > "make a data directory subdirectory in a secure and robust way".

> How about MakeDirectoryDefaultPerm()? That's what I'll go with if I
> don't hear any other ideas. The single call to MakeDirectoryPerm() will
> be reverted to mkdir() and I'll remove the function.

I'd go with MakeDirectory, documenting exactly what it does and why, and
be done with it. If your new function satisfies future users, great; if
not, it can be patched (or not) once we know exactly what these callers
need.

You know, YAGNI.

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabien COELHO 2018-01-10 18:42:26 Re: General purpose hashing func in pgbench
Previous Message Tom Lane 2018-01-10 18:06:50 Dubious shortcut in ckpt_buforder_comparator()