From 2f5ec6c14bd97afb28ffe6cd5a8699216e9a08a3 Mon Sep 17 00:00:00 2001 From: PshySimon Date: Wed, 9 Oct 2024 10:47:29 +0800 Subject: [PATCH] fix python 3.7 not support for list[bool] type --- ...ython-3.7-not-support-list-bool-type.patch | 53 +++++++++++++++++++ sysSentry.spec | 9 +++- 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 fix-python-3.7-not-support-list-bool-type.patch diff --git a/fix-python-3.7-not-support-list-bool-type.patch b/fix-python-3.7-not-support-list-bool-type.patch new file mode 100644 index 0000000..6214cda --- /dev/null +++ b/fix-python-3.7-not-support-list-bool-type.patch @@ -0,0 +1,53 @@ +From 878bcf61467bfd9d015a8089a8367f4333ba76f6 Mon Sep 17 00:00:00 2001 +From: PshySimon +Date: Wed, 9 Oct 2024 10:20:34 +0800 +Subject: [PATCH] fix python 3.7 not support list[bool] type + +--- + src/python/xalarm/register_xalarm.py | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/python/xalarm/register_xalarm.py b/src/python/xalarm/register_xalarm.py +index e58343d..6756b1b 100644 +--- a/src/python/xalarm/register_xalarm.py ++++ b/src/python/xalarm/register_xalarm.py +@@ -26,7 +26,7 @@ ALARM_REGISTER_INFO = None + + + class AlarmRegister: +- def __init__(self, id_filter: list[bool], callback: callable): ++ def __init__(self, id_filter: list, callback: callable): + self.id_filter = id_filter + self.callback = callback + self.socket = self.create_unix_socket() +@@ -49,7 +49,7 @@ class AlarmRegister: + return False + return True + +- def set_id_filter(self, id_filter: list[bool]) -> bool: ++ def set_id_filter(self, id_filter: list) -> bool: + if (len(id_filter) > MAX_NUM_OF_ALARM_ID): + sys.stderr.write("set_id_filter: invalid param id_filter\n") + return False +@@ -118,7 +118,7 @@ class AlarmRegister: + self.socket.close() + + +-def xalarm_register(callback: callable, id_filter: list[bool]) -> int: ++def xalarm_register(callback: callable, id_filter: list) -> int: + global ALARM_REGISTER_INFO + + if ALARM_REGISTER_INFO is not None: +@@ -148,7 +148,7 @@ def xalarm_unregister(clientId: int) -> None: + ALARM_REGISTER_INFO = None + + +-def xalarm_upgrade(clientId: int, id_filter: list[bool]) -> None: ++def xalarm_upgrade(clientId: int, id_filter: list) -> None: + global ALARM_REGISTER_INFO + if clientId < 0: + sys.stderr.write("xalarm_unregister: invalid client\n") +-- +2.27.0 + + diff --git a/sysSentry.spec b/sysSentry.spec index faac274..b71e351 100644 --- a/sysSentry.spec +++ b/sysSentry.spec @@ -4,7 +4,7 @@ Summary: System Inspection Framework Name: sysSentry Version: 1.0.2 -Release: 21 +Release: 22 License: Mulan PSL v2 Group: System Environment/Daemons Source0: https://gitee.com/openeuler/sysSentry/releases/download/v%{version}/%{name}-%{version}.tar.gz @@ -32,6 +32,7 @@ Patch19: fix-ai_block_io-some-issues.patch Patch20: add-ebpf-collector.patch Patch21: add-pyxalarm-and-pySentryNotify-add-multi-users-supp.patch Patch22: add-sentryctl-get_alarm-module_name-s-time_range-d.patch +Patch23: fix-python-3.7-not-support-list-bool-type.patch BuildRequires: cmake gcc-c++ BuildRequires: python3 python3-setuptools @@ -284,6 +285,12 @@ rm -rf %{buildroot} %attr(0550,root,root) %{python3_sitelib}/sentryPlugins/ai_block_io %changelog +* Wed Oct 9 2024 caixiaomeng - 1.0.2-22 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:fix python 3.7 not support list[bool] type + * Tue Oct 8 2024 jinsaihang - 1.0.2-21 - Type:bugfix - CVE:NA -- Gitee