]> granicus.if.org Git - postgresql/commit
Make current_logfiles use permissions assigned to files in data directory
authorMichael Paquier <michael@paquier.xyz>
Sun, 24 Mar 2019 12:01:10 +0000 (21:01 +0900)
committerMichael Paquier <michael@paquier.xyz>
Sun, 24 Mar 2019 12:01:10 +0000 (21:01 +0900)
commit7d7435c5c5050f280692d87f250fabd7eabc4af4
treef815e0007cbee87ca5630fb71c253aa0e9a04edf
parente319f03d12b1c624bd911be4a589cd635545ad74
Make current_logfiles use permissions assigned to files in data directory

Since its introduction in 19dc233c, current_logfiles has been assigned
the same permissions as a log file, which can be enforced with
log_file_mode.  This setup can lead to incompatibility problems with
group access permissions as current_logfiles is not located in the log
directory, but at the root of the data folder.  Hence, if group
permissions are used but log_file_mode is more restrictive, a backup
with a user in the group having read access could fail even if the log
directory is located outside of the data folder.

Per discussion with the folks mentioned below, we have concluded that
current_logfiles should not be treated as a log file as it only stores
metadata related to log files, and that it should use the same
permissions as all other files in the data directory.  This solution has
the merit to be simple and fixes all the interaction problems between
group access and log_file_mode.

Author: Haribabu Kommi
Reviewed-by: Stephen Frost, Robert Haas, Tom Lane, Michael Paquier
Discussion: https://postgr.es/m/CAJrrPGcEotF1P7AWoeQyD3Pqr-0xkQg_Herv98DjbaMj+naozw@mail.gmail.com
Backpatch-through: 11, where group access has been added.
src/backend/postmaster/syslogger.c