OpenFile() Permissions Refactor

From: David Steele <david(at)pgmasters(dot)net>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: OpenFile() Permissions Refactor
Date: 2017-08-29 16:15:28
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


While working on the patch to allow group reads of $PGDATA I refactored
the various OpenFile() functions to use default/global permissions
rather than permissions defined in each call.

I think the patch stands on its own regardless of whether we accept the
patch to allow group permissions (which won't make this CF). We had a
couple different ways of defining permissions (e.g. 0600 vs S_IRUSR |
S_IWUSR) and in any case it represented quite a bit of duplication.
This way seems simpler and less error-prone.

I have intentionally not touched the open/fopen/mkdir calls in these
files since they are specialized and require per-instance consideration
(if they are changed at all):


All tests pass but it's possible that I've missed something or changed
something that shouldn't be changed.

I'll submit the patch to the 2017-09 CF.


Attachment Content-Type Size
file-open-perm-refactor-v1.patch text/plain 31.9 KB


Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-08-29 16:35:43 Re: [HACKERS] [postgresql 10 beta3] unrecognized node type: 90
Previous Message Robert Haas 2017-08-29 15:21:33 Re: Explicit relation name in VACUUM VERBOSE log