Re: current_logfiles not following group access and instead followslog_file_mode permissions - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: current_logfiles not following group access and instead followslog_file_mode permissions
Date
Msg-id 20190322012354.GM20192@paquier.xyz
Whole thread Raw
In response to Re: current_logfiles not following group access and instead followslog_file_mode permissions  (Haribabu Kommi <kommi.haribabu@gmail.com>)
Responses Re: current_logfiles not following group access and instead followslog_file_mode permissions
List pgsql-hackers
On Thu, Mar 21, 2019 at 12:52:14PM +1100, Haribabu Kommi wrote:
> Earlier attached patch is wrong.

-   oumask = umask(pg_file_create_mode);
+   oumask = umask(pg_mode_mask);
Indeed that was wrong.

> Correct patch attached. Sorry for the inconvenience.

This looks better for the umask setting, still it could be more
simple.

 #include <sys/time.h>
-
+#include "common/file_perm.h"
 #include "lib/stringinfo.h"
Nit: it is better for readability to keep an empty line between the
system includes and the Postgres ones.

A second thing, more important, is that you can reset umask just after
opening the file, as attached.  This way there is no need to reset the
umask in all the code paths leaving update_metainfo_datafile().  Does
that look fine to you?
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Takuma Hoshiai
Date:
Subject: Re: Proposal to suppress errors thrown by to_reg*()
Next
From: Michael Paquier
Date:
Subject: Re: Special role for subscriptions