diff --git a/bugfix-fix-fd-path-failed-to-open.patch b/bugfix-fix-fd-path-failed-to-open.patch new file mode 100644 index 0000000000000000000000000000000000000000..bab67b0790cea32ba78cff8bf399899790ae903d --- /dev/null +++ b/bugfix-fix-fd-path-failed-to-open.patch @@ -0,0 +1,48 @@ +From 9241d98bc5803d18b1e17bd3ba1b84e97207fab4 Mon Sep 17 00:00:00 2001 +From: tenglei +Date: Thu, 11 Apr 2024 17:55:13 +0800 +Subject: [PATCH] bugfix fix fd path failed to open + +--- + src/sys_event.c | 22 ++++++++++++++++------ + 1 file changed, 16 insertions(+), 6 deletions(-) + +diff --git a/src/sys_event.c b/src/sys_event.c +index 61701ec..dbdb9d0 100644 +--- a/src/sys_event.c ++++ b/src/sys_event.c +@@ -544,15 +544,25 @@ static int chang_kernel_interface_value(void) + return -1; + } + +- ret = set_value_to_file(buf, PROC_FDTHRESHOLD); +- if (ret == -1) { +- log_printf(LOG_ERR, "chang_kernel_interface_value: set_value_to_file failed"); ++ if (access(PROC_FDTHRESHOLD, F_OK) == 0) { ++ ret = set_value_to_file(buf, PROC_FDTHRESHOLD); ++ if (ret == -1) { ++ log_printf(LOG_ERR, "chang_kernel_interface_value: set_value_to_file failed"); ++ return -1; ++ } ++ } else { ++ log_printf(LOG_ERR, "fdthreshold function is not supported in the current system environment"); + return -1; + } + +- ret = set_value_to_file("1", RROC_FDENABLE); +- if (ret == -1) { +- log_printf(LOG_ERR, "chang_kernel_interface_value: set_value_to_file failed"); ++ if (access(RROC_FDENABLE, F_OK) == 0) { ++ ret = set_value_to_file("1", RROC_FDENABLE); ++ if (ret == -1) { ++ log_printf(LOG_ERR, "chang_kernel_interface_value: set_value_to_file failed"); ++ return -1; ++ } ++ } else { ++ log_printf(LOG_ERR, "fdenable function is not supported in the current system environment"); + return -1; + } + +-- +2.27.0 + diff --git a/sysmonitor-kmod.spec b/sysmonitor-kmod.spec index db9095db285c4458e4c4b113c2c83b14431a8528..07b9eddfb0f78e548f011a8e826f4401191c03d2 100644 --- a/sysmonitor-kmod.spec +++ b/sysmonitor-kmod.spec @@ -7,7 +7,7 @@ %define kmod_name sysmonitor %define rpmversion 1.3.2 -%define releaseversion 1.2 +%define releaseversion 1.3 Summary: System Monitor Daemon Name: %{kmod_name}-kmod Version: %{rpmversion} @@ -36,6 +36,7 @@ Requires: python3 Provides: sysmonitor Patch1: bugfix-fix-signal-monitor-err.patch +Patch2: bugfix-fix-fd-path-failed-to-open.patch %description System Monitor Daemon @@ -170,6 +171,12 @@ systemctl daemon-reload 2>/dev/null 1>/dev/null /usr/lib/systemd/system/multi-user.target.wants/sysmonitor.service %changelog +* Wed Jun 19 2024 hanhuihui - 1.3.2-1.3 +- Type:bugfix +- CVE:NA +- SUG:restart +- DESC: fix bug fd interface failed to open + * Tue Nov 28 2023 xietangxin - 1.3.2-1.2 - Type:bugfix - CVE:NA