Re: current_logfiles not following group access and instead follows log_file_mode permissions

From: Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Gilles Darold <gilles(dot)darold(at)dalibo(dot)com>
Subject: Re: current_logfiles not following group access and instead follows log_file_mode permissions
Date: 2019-02-26 01:22:53
Message-ID: CAJrrPGdh+7LWafhQ1xerQ+Ov_UVZp3WmvUEA3AsY0jxqeYaWJw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Feb 4, 2019 at 12:16 PM Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>
wrote:

>
> And regarding current_logfiles permissions, I feel this file should have
> permissions of data directory files as it is present in the data directory
> whether it stores the information of log file, until this file is
> completely
> removed with another approach to store the log file details.
>
> I am not sure whether this has been already discussed or not? How about
> using shared memory to store the log file names? So that we don't need
> of this file?
>

I checked the code why the current_logfiles is not implemented as shared
memory
and found that the current syslogger doesn't attach to the shared memory of
the
postmaster. To support storing the current_logfiles in shared memory, the
syslogger
process also needs to attach to the shared memory, this seems to be a new
infrastructure
change.

In case if we are not going to change the permissions of the file to group
access mode
instead of if we strict with log_file_mode, I just tried the attached patch
of moving the
current_logfiles patch to the log_directory. The only drawback of this
approach, is incase
if the user changes the log_directory, the current_logfiles is present in
the old log_directory.
I don't see that as a problem.

comments?

Regards,
Haribabu Kommi
Fujitsu Australia

Attachment Content-Type Size
0001-Move-the-current_logfiles-file-into-log_directory.patch application/octet-stream 6.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Merlin Moncure 2019-02-26 01:34:51 crosstab/repivot...any interest?
Previous Message Jamison, Kirk 2019-02-26 01:08:30 RE: Timeout parameters