rasdaemon: Fix startup core dumped issue.
Add the following patch to fix startup core dumped issue. 0001-rasdaemon-use-standard-length-PATH_MAX-for-path-name.patch Signed-off-by: Xiaofei Tan <tanxiaofei@huawei.com> (cherry picked from commit c5e8cb9176935b30077e38e50a2b7e280903460e)
This commit is contained in:
parent
60f807df1e
commit
e5920d76da
@ -0,0 +1,46 @@
|
|||||||
|
From: Xiaofei Tan <tanxiaofei@huawei.com>
|
||||||
|
Date: Sat, 20 Aug 2022 09:49:25 +0000
|
||||||
|
Subject: [PATCH] rasdaemon: use standard length PATH_MAX for path name
|
||||||
|
|
||||||
|
Use standard length PATH_MAX for path name space allocation
|
||||||
|
to replace the macro MAX_PATH_LEN.
|
||||||
|
|
||||||
|
Signed-off-by: Xiaofei Tan <tanxiaofei@huawei.com>
|
||||||
|
---
|
||||||
|
ras-cpu-isolation.c | 6 +++---
|
||||||
|
ras-cpu-isolation.h | 1 -
|
||||||
|
2 files changed, 3 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/ras-cpu-isolation.c b/ras-cpu-isolation.c
|
||||||
|
index ba5ccd1..24c07e9 100644
|
||||||
|
--- a/ras-cpu-isolation.c
|
||||||
|
+++ b/ras-cpu-isolation.c
|
||||||
|
@@ -80,11 +80,11 @@ static const char * const cpu_state[] = {
|
||||||
|
static int open_sys_file(unsigned int cpu, int __oflag, const char *format)
|
||||||
|
{
|
||||||
|
int fd;
|
||||||
|
- char path[MAX_PATH_LEN + 1] = "";
|
||||||
|
- char real_path[MAX_PATH_LEN + 1] = "";
|
||||||
|
+ char path[PATH_MAX] = "";
|
||||||
|
+ char real_path[PATH_MAX] = "";
|
||||||
|
|
||||||
|
snprintf(path, sizeof(path), format, cpu);
|
||||||
|
- if (strlen(path) > MAX_PATH_LEN || realpath(path, real_path) == NULL) {
|
||||||
|
+ if (strlen(path) > PATH_MAX || realpath(path, real_path) == NULL) {
|
||||||
|
log(TERM, LOG_ERR, "[%s]:open file: %s failed\n", __func__, path);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
diff --git a/ras-cpu-isolation.h b/ras-cpu-isolation.h
|
||||||
|
index 024a68b..5682106 100644
|
||||||
|
--- a/ras-cpu-isolation.h
|
||||||
|
+++ b/ras-cpu-isolation.h
|
||||||
|
@@ -17,7 +17,6 @@
|
||||||
|
|
||||||
|
#include "queue.h"
|
||||||
|
|
||||||
|
-#define MAX_PATH_LEN 100
|
||||||
|
#define MAX_BUF_LEN 1024
|
||||||
|
|
||||||
|
struct param {
|
||||||
|
--
|
||||||
|
2.17.1
|
||||||
@ -1,6 +1,6 @@
|
|||||||
Name: rasdaemon
|
Name: rasdaemon
|
||||||
Version: 0.6.7
|
Version: 0.6.7
|
||||||
Release: 5
|
Release: 6
|
||||||
License: GPLv2
|
License: GPLv2
|
||||||
Summary: Utility to get Platform Reliability, Availability and Serviceability (RAS) reports via the Kernel tracing events
|
Summary: Utility to get Platform Reliability, Availability and Serviceability (RAS) reports via the Kernel tracing events
|
||||||
URL: https://github.com/mchehab/rasdaemon.git
|
URL: https://github.com/mchehab/rasdaemon.git
|
||||||
@ -37,6 +37,7 @@ Patch15: 0007-rasdaemon-ras-mc-ctl-Add-support-to-display-the-HiSi.patch
|
|||||||
Patch16: 0008-rasdaemon-ras-mc-ctl-Relocate-reading-and-display-Ku.patch
|
Patch16: 0008-rasdaemon-ras-mc-ctl-Relocate-reading-and-display-Ku.patch
|
||||||
Patch17: 0009-rasdaemon-ras-mc-ctl-Updated-HiSilicon-platform-name.patch
|
Patch17: 0009-rasdaemon-ras-mc-ctl-Updated-HiSilicon-platform-name.patch
|
||||||
Patch18: 0010-rasdaemon-Fix-for-a-memory-out-of-bounds-issue-and-o.patch
|
Patch18: 0010-rasdaemon-Fix-for-a-memory-out-of-bounds-issue-and-o.patch
|
||||||
|
Patch19: 0001-rasdaemon-use-standard-length-PATH_MAX-for-path-name.patch
|
||||||
|
|
||||||
%description
|
%description
|
||||||
The rasdaemon program is a daemon which monitors the platform
|
The rasdaemon program is a daemon which monitors the platform
|
||||||
@ -82,6 +83,14 @@ rm INSTALL %{buildroot}/usr/include/*.h
|
|||||||
/usr/bin/systemctl enable rasdaemon.service >/dev/null 2>&1 || :
|
/usr/bin/systemctl enable rasdaemon.service >/dev/null 2>&1 || :
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Aug 25 2022 Xiaofei Tan <tanxiaofei@huawei.com> - 0.6.7-6
|
||||||
|
- Type:bugfix
|
||||||
|
- ID:NA
|
||||||
|
- SUG:NA
|
||||||
|
- DESC:
|
||||||
|
Add the following patch to fix startup core dumped issue.
|
||||||
|
0001-rasdaemon-use-standard-length-PATH_MAX-for-path-name.patch
|
||||||
|
|
||||||
* Mon May 23 2022 Shiju Jose<shiju.jose@huawei.com> - 0.6.7-5
|
* Mon May 23 2022 Shiju Jose<shiju.jose@huawei.com> - 0.6.7-5
|
||||||
- Type:feature
|
- Type:feature
|
||||||
- ID:NA
|
- ID:NA
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user