From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Stephen Frost <sfrost(at)snowman(dot)net> |
Cc: | Michael Paquier <michael(at)paquier(dot)xyz>, Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>, 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-01-16 18:39:31 |
Message-ID: | 18825.1547663971@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Stephen Frost <sfrost(at)snowman(dot)net> writes:
> * Michael Paquier (michael(at)paquier(dot)xyz) wrote:
>> On Tue, Jan 15, 2019 at 10:53:30AM -0500, Tom Lane wrote:
>>> On reflection, maybe the problem is not that we're giving the file
>>> the wrong permissions, but that we're putting it in the wrong place?
> I'm not really sure putting it into the logfile directory is such a hot
> idea as users might have set up external log file rotation of files in
> that directory. Of course, in that case they'd probably signal PG right
> afterwards and PG would go write out a new file, but it still seems
> pretty awkward. I'm not terribly against solving this issue that way
> either though, but I tend to think the originally proposed patch is more
> sensible.
I dunno, I think that the current design was made without any thought
whatsoever about the log-files-outside-the-data-directory case. If
you're trying to set things up that way, it's because you want to give
logfile read access to people who shouldn't be able to look into the
data directory proper. That makes current_logfiles pretty useless
to such people, as it's now designed.
Now, if the expectation is that current_logfiles is just an internal
working file that users shouldn't access directly, then this argument
is wrong --- but then why is it documented in user-facing docs?
If we're going to accept the patch as-is, then it logically follows
that we should de-document current_logfiles, because we're taking the
position that it's an internal temporary file not meant for user access.
I don't really believe your argument about log rotation: a rotator
would presumably be configured either to pay attention to file name
patterns (which current_logfiles wouldn't match) or to file age
(which current_logfiles shouldn't satisfy either, since it's always
rewritten when we switch logfiles).
If we wanted to worry about that case, a possible solution is to make the
current_logfiles pathname user-configurable so it could be put in some
third directory. But I think that adds more complexity than is justified
--- and not just for us, but for programs trying to find and use
current_logfiles.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Stephen Frost | 2019-01-16 18:49:54 | Re: current_logfiles not following group access and instead follows log_file_mode permissions |
Previous Message | Tom Lane | 2019-01-16 18:26:36 | Re: Proving IS NOT NULL inference for ScalarArrayOpExpr's |