diff --git a/doc/xml/release.xml b/doc/xml/release.xml
index f56d57ed9..aa9b8717d 100644
--- a/doc/xml/release.xml
+++ b/doc/xml/release.xml
@@ -22,6 +22,14 @@
The start/stop commands are implemented entirely in C.
+
+
+
+
+
+
+ Create log directories/files with 0750/0640 mode.
+
@@ -7272,6 +7280,11 @@
cmwshang
+
+ Damiano Albani
+ dalbani
+
+
Dan Farrell
farrellit
diff --git a/lib/pgBackRest/Common/Log.pm b/lib/pgBackRest/Common/Log.pm
index 4f471300e..3354edd4a 100644
--- a/lib/pgBackRest/Common/Log.pm
+++ b/lib/pgBackRest/Common/Log.pm
@@ -130,13 +130,13 @@ sub logFileSet
# Only open the log file if file logging is enabled
if ($strLogLevelFile ne OFF)
{
- $oStorage->pathCreate(dirname($strFile), {strMode => '0770', bIgnoreExists => true, bCreateParent => true});
+ $oStorage->pathCreate(dirname($strFile), {strMode => '0750', bIgnoreExists => true, bCreateParent => true});
$strFile .= '.log';
$bLogFileExists = -e $strFile ? true : false;
$bLogFileFirst = defined($bLogFileFirstParam) ? $bLogFileFirstParam : false;
- if (!sysopen($hLogFile, $strFile, O_WRONLY | O_CREAT | O_APPEND, oct('0660')))
+ if (!sysopen($hLogFile, $strFile, O_WRONLY | O_CREAT | O_APPEND, oct('0640')))
{
logErrorResult(ERROR_FILE_OPEN, "unable to open log file '${strFile}'", $OS_ERROR);
}
diff --git a/src/common/log.c b/src/common/log.c
index c7ad3f71a..cc3de5797 100644
--- a/src/common/log.c
+++ b/src/common/log.c
@@ -211,7 +211,7 @@ logFileSet(const char *logFile)
if (logLevelFile != logLevelOff)
{
// Open the file and handle errors
- logHandleFile = open(logFile, O_CREAT | O_APPEND | O_WRONLY, 0750);
+ logHandleFile = open(logFile, O_CREAT | O_APPEND | O_WRONLY, 0640);
if (logHandleFile == -1)
{
diff --git a/src/perl/embed.auto.c b/src/perl/embed.auto.c
index 2d3b89801..b12315852 100644
--- a/src/perl/embed.auto.c
+++ b/src/perl/embed.auto.c
@@ -5475,13 +5475,13 @@ static const EmbeddedModule embeddedModule[] =
"\n\n"
"if ($strLogLevelFile ne OFF)\n"
"{\n"
- "$oStorage->pathCreate(dirname($strFile), {strMode => '0770', bIgnoreExists => true, bCreateParent => true});\n"
+ "$oStorage->pathCreate(dirname($strFile), {strMode => '0750', bIgnoreExists => true, bCreateParent => true});\n"
"\n"
"$strFile .= '.log';\n"
"$bLogFileExists = -e $strFile ? true : false;\n"
"$bLogFileFirst = defined($bLogFileFirstParam) ? $bLogFileFirstParam : false;\n"
"\n"
- "if (!sysopen($hLogFile, $strFile, O_WRONLY | O_CREAT | O_APPEND, oct('0660')))\n"
+ "if (!sysopen($hLogFile, $strFile, O_WRONLY | O_CREAT | O_APPEND, oct('0640')))\n"
"{\n"
"logErrorResult(ERROR_FILE_OPEN, \"unable to open log file '${strFile}'\", $OS_ERROR);\n"
"}\n"