Re: current_logfiles not following group access and instead follows log_file_mode permissions
Haribabu Kommi <kommi.haribabu@gmail.com>
From: Haribabu Kommi <kommi.haribabu@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Stephen Frost <sfrost@snowman.net>, Tom Lane <tgl@sss.pgh.pa.us>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Gilles Darold <gilles.darold@dalibo.com>
Date: 2019-03-22T03:35:41Z
Lists: pgsql-hackers
On Fri, Mar 22, 2019 at 12:24 PM Michael Paquier <michael@paquier.xyz> wrote: > 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? > Thanks for the correction, Yes, that is correct and it works fine. Regards, Haribabu Kommi Fujitsu Australia
Commits
-
Make current_logfiles use permissions assigned to files in data directory
- 7d7435c5c505 11.3 landed
- 276d2e6c2d81 12.0 landed