summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorFujii Masao2026-05-20 06:54:13 +0000
committerFujii Masao2026-05-20 06:54:13 +0000
commit263d1e6dfeec5e573db4f78e6dac4bb17259c482 (patch)
tree72bf8669aaaca6c6d28814d68b68de794d0c938c /src/bin
parent0160143ad9a686a7e705348da1f90e63a2a31536 (diff)
pg_recvlogical: Honor source cluster file permissions for output files
Commit c37b3d08ca6 attempted to preserve group permissions on pg_recvlogical output files when group access was enabled on the source cluster. However, the output files were still created with a fixed S_IRUSR | S_IWUSR mode, preventing group-read permissions from being applied. This commit fixes the issue by creating output files with pg_file_create_mode instead of a hard-coded mode. This allows pg_recvlogical to correctly preserve group permissions from the source cluster. Backpatch to all supported branches. Author: Fujii Masao <masao.fujii@gmail.com> Reviewed-by: Srinath Reddy Sadipiralla <srinath2133@gmail.com> Discussion: https://postgr.es/m/CAHGQGwHhpizYzMo3nFP4GkNMueSNMY3QfC-gBN1VTXtuiANDvw@mail.gmail.com Backpatch-through: 14
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/pg_basebackup/pg_recvlogical.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bin/pg_basebackup/pg_recvlogical.c b/src/bin/pg_basebackup/pg_recvlogical.c
index be71783b370..2fdf64bcadb 100644
--- a/src/bin/pg_basebackup/pg_recvlogical.c
+++ b/src/bin/pg_basebackup/pg_recvlogical.c
@@ -342,7 +342,7 @@ StreamLogicalLog(void)
outfd = fileno(stdout);
else
outfd = open(outfile, O_CREAT | O_APPEND | O_WRONLY | PG_BINARY,
- S_IRUSR | S_IWUSR);
+ pg_file_create_mode);
if (outfd == -1)
{
pg_log_error("could not open log file \"%s\": %m", outfile);