diff --git a/param-must-be-integer.patch b/param-must-be-integer.patch new file mode 100644 index 0000000000000000000000000000000000000000..d9b7ac17ff7562ac26faaf2ac33e190777779844 --- /dev/null +++ b/param-must-be-integer.patch @@ -0,0 +1,23 @@ +From 34febf57060060d1f8262941af49e3beeb1f7f5d Mon Sep 17 00:00:00 2001 +From: jwolf <523083921@qq.com> +Date: Fri, 30 Aug 2024 16:59:56 +0800 +Subject: [PATCH] param must be integer + +--- + src/c/catcli/catlib/cli_param_checker.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/c/catcli/catlib/cli_param_checker.c b/src/c/catcli/catlib/cli_param_checker.c +index 5b38402..71edf17 100644 +--- a/src/c/catcli/catlib/cli_param_checker.c ++++ b/src/c/catcli/catlib/cli_param_checker.c +@@ -17,6 +17,7 @@ void checkset_cpu_usage_percentage(char *getopt_optarg, catcli_request_body *p_r + if (cpu_utility <= 0 || cpu_utility > CPU_USAGE_PERCENTAGE_MAX || strchr(getopt_optarg, '.') != NULL) { + strncpy(errs->patrol_module_err, + "\"cpu_utility \" must be an integer greater in the range (0,100],correct \"-u, --cpu_utility\"\n", MAX_ERR_LEN); ++ p_request_body->cpu_utility = 0; + } else { + p_request_body->cpu_utility = (int)cpu_utility; + } +-- +Gitee diff --git a/setting-parameters-must-be-integer.patch b/setting-parameters-must-be-integer.patch new file mode 100644 index 0000000000000000000000000000000000000000..20e11f7aeb32d59f0640aaf63926878ca37844e9 --- /dev/null +++ b/setting-parameters-must-be-integer.patch @@ -0,0 +1,38 @@ +From 4abad77067557234d938de3914094c80181030c1 Mon Sep 17 00:00:00 2001 +From: jwolf <523083921@qq.com> +Date: Fri, 30 Aug 2024 14:30:46 +0800 +Subject: [PATCH] must be integer + +--- + c/catcli/catlib/cli_param_checker.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/src/c/catcli/catlib/cli_param_checker.c b/src/c/catcli/catlib/cli_param_checker.c +index e400428..5b38402 100644 +--- a/src/c/catcli/catlib/cli_param_checker.c ++++ b/src/c/catcli/catlib/cli_param_checker.c +@@ -17,8 +17,9 @@ void checkset_cpu_usage_percentage(char *getopt_optarg, catcli_request_body *p_r + if (cpu_utility <= 0 || cpu_utility > CPU_USAGE_PERCENTAGE_MAX || strchr(getopt_optarg, '.') != NULL) { + strncpy(errs->patrol_module_err, + "\"cpu_utility \" must be an integer greater in the range (0,100],correct \"-u, --cpu_utility\"\n", MAX_ERR_LEN); ++ } else { ++ p_request_body->cpu_utility = (int)cpu_utility; + } +- p_request_body->cpu_utility = (int)cpu_utility; + } + + void checkset_cpulist(char *getopt_optarg, catcli_request_body *p_request_body, struct option_errs *errs) +@@ -73,8 +74,9 @@ void checkset_patrol_time(char *getopt_optarg, catcli_request_body *p_request_bo + strncpy(errs->patrol_time_err, + "\"patrol_second\" must be a number in the range of (0,INT_MAX] ,correct \"-t, --patrol_second\"\n", + MAX_ERR_LEN); ++ } else { ++ p_request_body->patrol_second = (int)second; + } +- p_request_body->patrol_second = (int)second; + } + + void checkset_patrol_type(char *getopt_optarg, catcli_request_body *p_request_body, struct option_errs *errs) +-- +2.27.0 + diff --git a/sysSentry.spec b/sysSentry.spec index 1bced8fdfe1ac4826c11353f990f9086ec758172..5a79ba84613bbcda5f6d316d797c369337073a62 100644 --- a/sysSentry.spec +++ b/sysSentry.spec @@ -4,7 +4,7 @@ Summary: System Inspection Framework Name: sysSentry Version: 1.0.2 -Release: 5 +Release: 6 License: Mulan PSL v2 Group: System Environment/Daemons Source0: https://gitee.com/openeuler/sysSentry/releases/download/v%{version}/%{name}-%{version}.tar.gz @@ -15,6 +15,8 @@ Patch2: Fix-the-problem-that-function-cpu_report_result-is-c.patch Patch3: fix-error-handling.patch Patch4: fix-result-when-process-output-is-None.patch Patch5: cpu_utility-and-cpu_patrol-must-be-an-integer.patch +Patch6: setting-parameters-must-be-integer.patch +Patch7: param-must-be-integer.patch BuildRequires: cmake gcc-c++ BuildRequires: python3 python3-setuptools @@ -171,6 +173,12 @@ rm -rf %{buildroot} %attr(0550,root,root) %{python3_sitelib}/syssentry/cpu_* %changelog +* Fri Aug 30 2024 shixuantong - 1.0.2-6 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:setting parameters must be integer + * Wed Aug 28 2024 shixuantong - 1.0.2-5 - Type:bugfix - CVE:NA