!45 deleted: rsyslog-8.24.0-set-permission-of-syslogd-dot-pid-to-0644.patch

From: @wcc_140409 
Reviewed-by: @yanan-rock 
Signed-off-by: @yanan-rock
This commit is contained in:
openeuler-ci-bot 2022-02-23 06:28:11 +00:00 committed by Gitee
commit 2589cbb07f
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 11 additions and 76 deletions

View File

@ -1,52 +0,0 @@
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

View File

@ -1,4 +1,4 @@
From 9a137580322bd863a48479755aee9c30d0a084e9 Mon Sep 17 00:00:00 2001
From 5ce33ba295e9e210aff7cb137998d8490583d516 Mon Sep 17 00:00:00 2001
From: wangshouping <wangshouping@huawei.com>
Date: Wed, 15 Apr 2020 03:07:55 -0400
Subject: [PATCH] rsyslog-8.37.0-initialize-variables-and-check-return-value
@ -6,11 +6,10 @@ Subject: [PATCH] rsyslog-8.37.0-initialize-variables-and-check-return-value
Signed-off-by: wangshouping <wangshouping@huawei.com>
---
plugins/imjournal/imjournal.c | 22 +++++++++++++---------
tools/rsyslogd.c | 2 +-
2 files changed, 14 insertions(+), 10 deletions(-)
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/plugins/imjournal/imjournal.c b/plugins/imjournal/imjournal.c
index 3a93b37..1656de7 100644
index aa27fe7..c5d3d25 100644
--- a/plugins/imjournal/imjournal.c
+++ b/plugins/imjournal/imjournal.c
@@ -386,7 +386,7 @@ readjournal(void)
@ -57,19 +56,5 @@ index 3a93b37..1656de7 100644
}else
/* submit message */
enqMsg((uchar *)message, (uchar *) sys_iden_help, facility, severity, &tv, json, 0);
diff --git a/tools/rsyslogd.c b/tools/rsyslogd.c
index 6b531b1..7832693 100644
--- a/tools/rsyslogd.c
+++ b/tools/rsyslogd.c
@@ -266,7 +266,7 @@ static rsRetVal
writePidFile(void)
{
FILE *fp;
- int fd;
+ int fd = -1;
DEFiRet;
const char *tmpPidFile;
--
2.19.1
2.27.0

View File

@ -4,7 +4,7 @@
Name: rsyslog
Version: 8.2110.0
Release: 4
Release: 5
Summary: The rocket-fast system for log processing
License: (GPLv3+ and ASL 2.0)
URL: http://www.rsyslog.com/
@ -22,10 +22,9 @@ Source9: timezone_update.sh
Patch9000: rsyslog-8.24.0-ensure-parent-dir-exists-when-writting-log-file.patch
Patch9001: bugfix-rsyslog-7.4.7-imjournal-add-monotonic-timestamp.patch
Patch9002: bugfix-rsyslog-7.4.7-add-configuration-to-avoid-memory-leak.patch
Patch9003: rsyslog-8.24.0-set-permission-of-syslogd-dot-pid-to-0644.patch
Patch9004: rsyslog-8.37.0-initialize-variables-and-check-return-value.patch
Patch9005: print-main-queue-info-to-journal-when-queue-full.patch
Patch9006: print-main-queue-info-to-journal-when-receive-USR1-signal.patch
Patch9003: rsyslog-8.37.0-initialize-variables-and-check-return-value.patch
Patch9004: print-main-queue-info-to-journal-when-queue-full.patch
Patch9005: print-main-queue-info-to-journal-when-receive-USR1-signal.patch
BuildRequires: gcc autoconf automake bison dos2unix flex pkgconfig python3-docutils libtool
BuildRequires: libgcrypt-devel libuuid-devel zlib-devel krb5-devel libnet-devel gnutls-devel
@ -477,6 +476,9 @@ done
%{_mandir}/man1/rscryutil.1.gz
%changelog
* Wed Feb 23 wuchaochao <cyanrose@yeah.net> - 8.2110.0-5
- deleted: rsyslog-8.24.0-set-permission-of-syslogd-dot-pid-to-0644.patch
* Sat Feb 19 2022 liuyumeng <liuyumeng5@h-partners.com> - 8.2110.0-4
- print main queue info to journal