代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/rsyslog 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 1b1efc640a57a757d1c7c64fd60d2187e3940060 Mon Sep 17 00:00:00 2001
From: guoxiaoqi <guoxiaoqi2@huawei.com>
Date: Sat, 26 Jan 2019 15:27:29 +0000
Subject: [PATCH] rsyslog-8.24.0, set permission of syslogd dot pid to 0644
reason: rsyslog-8.24.0, set permission of syslogd dot pid to 0644
Signed-off-by: guoxiaoqi <guoxiaoqi2@huawei.com>
---
tools/rsyslogd.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/tools/rsyslogd.c b/tools/rsyslogd.c
index d2e4833..834fc08 100644
--- a/tools/rsyslogd.c
+++ b/tools/rsyslogd.c
@@ -28,6 +28,7 @@
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
+#include <fcntl.h>
#include <errno.h>
#ifdef ENABLE_LIBLOGGING_STDLOG
# include <liblogging/stdlog.h>
@@ -265,6 +266,7 @@ static rsRetVal
writePidFile(void)
{
FILE *fp;
+ int fd;
DEFiRet;
const char *tmpPidFile;
@@ -278,10 +280,15 @@ writePidFile(void)
if(tmpPidFile == NULL)
tmpPidFile = PidFile;
DBGPRINTF("rsyslogd: writing pidfile '%s'.\n", tmpPidFile);
- if((fp = fopen((char*) tmpPidFile, "w")) == NULL) {
+ if ( (fd = open(tmpPidFile, O_WRONLY|O_CREAT|O_CLOEXEC, 0644)) == -1) {
perror("rsyslogd: error writing pid file (creation stage)\n");
ABORT_FINALIZE(RS_RET_ERR);
}
+ if ((fp = fdopen(fd, "w")) == NULL) {
+ close(fd);
+ perror("rsyslogd: error writing pid file (fp binding stage)\n");
+ ABORT_FINALIZE(RS_RET_ERR);
+ }
if(fprintf(fp, "%d", (int) glblGetOurPid()) < 0) {
LogError(errno, iRet, "rsyslog: error writing pid file");
}
--
1.8.3.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。