mirror of
https://github.com/postgres/postgres.git
synced 2026-05-28 04:35:45 -04:00
pg_recvlogical: Honor source cluster file permissions for output files
Commit c37b3d08ca 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
This commit is contained in:
parent
0160143ad9
commit
263d1e6dfe
2 changed files with 2 additions and 2 deletions
|
|
@ -494,7 +494,7 @@ PostgreSQL documentation
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
<application>pg_recvlogical</application> will preserve group permissions on
|
<application>pg_recvlogical</application> will preserve group permissions on
|
||||||
the received WAL files if group permissions are enabled on the source
|
the output files if group permissions are enabled on the source
|
||||||
cluster.
|
cluster.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -342,7 +342,7 @@ StreamLogicalLog(void)
|
||||||
outfd = fileno(stdout);
|
outfd = fileno(stdout);
|
||||||
else
|
else
|
||||||
outfd = open(outfile, O_CREAT | O_APPEND | O_WRONLY | PG_BINARY,
|
outfd = open(outfile, O_CREAT | O_APPEND | O_WRONLY | PG_BINARY,
|
||||||
S_IRUSR | S_IWUSR);
|
pg_file_create_mode);
|
||||||
if (outfd == -1)
|
if (outfd == -1)
|
||||||
{
|
{
|
||||||
pg_log_error("could not open log file \"%s\": %m", outfile);
|
pg_log_error("could not open log file \"%s\": %m", outfile);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue