Re: PATCH: Configurable file mode mask

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>, David Steele <david(at)pgmasters(dot)net>
Cc: "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-09 01:58:29
Message-ID: 2caea453-0ac8-bf98-7623-3afbcb2d1372@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 1/3/18 08:11, Robert Haas wrote:
> On Tue, Jan 2, 2018 at 11:43 AM, David Steele <david(at)pgmasters(dot)net> wrote:
>>>> I think MakeDirectory() is a good wrapper, but isn't
>>> MakeDirectoryPerm() sort of silly?
>>
>> There's one place in the backend (storage/ipc/ipc.c) that sets non-default
>> directory permissions. This function is intended to support that and any
>> extensions that need to set custom perms.
>
> Yeah, but all it does is call mkdir(), which could just as well be
> called directly. I think there's a pointer to a wrapper when it does
> something for you -- supply an argument, log something, handle
> portability concerns -- but this wrapper does exactly nothing.

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".

--
Peter Eisentraut http://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 Peter Eisentraut 2018-01-09 02:24:55 Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions
Previous Message Andres Freund 2018-01-09 01:30:10 Re: Unimpressed with pg_attribute_always_inline