From ccf4c51a7a3de1be144361cec35c6fa913efd44b Mon Sep 17 00:00:00 2001 From: dongyuzhen Date: Mon, 19 May 2025 11:43:41 +0800 Subject: [PATCH] sync patch from upstream --- ...ugfix-fix-cdi-hook-name-strcmp-error.patch | 32 +++++++++++++++++++ iSulad.spec | 9 +++++- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 0202-bugfix-fix-cdi-hook-name-strcmp-error.patch diff --git a/0202-bugfix-fix-cdi-hook-name-strcmp-error.patch b/0202-bugfix-fix-cdi-hook-name-strcmp-error.patch new file mode 100644 index 0000000..c4d5218 --- /dev/null +++ b/0202-bugfix-fix-cdi-hook-name-strcmp-error.patch @@ -0,0 +1,32 @@ +From d7689c4f36949d5b315de776a1bb32a4cde04584 Mon Sep 17 00:00:00 2001 +From: liuxu +Date: Sun, 27 Apr 2025 16:52:19 +0800 +Subject: [PATCH] bugfix: fix cdi hook name strcmp error + +Signed-off-by: liuxu +--- + .../modules/device/cdi/behavior/cdi_container_edits.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/daemon/modules/device/cdi/behavior/cdi_container_edits.c b/src/daemon/modules/device/cdi/behavior/cdi_container_edits.c +index d146f7e1..38842f3b 100644 +--- a/src/daemon/modules/device/cdi/behavior/cdi_container_edits.c ++++ b/src/daemon/modules/device/cdi/behavior/cdi_container_edits.c +@@ -404,11 +404,11 @@ static int apply_cdi_hooks(cdi_container_edits *e, oci_runtime_spec *spec) + + for (i = 0; i < e->hooks_len; i++) { + defs_hook *oci_hook = cdi_hook_to_oci(e->hooks[i]); +- if (strcmp(e->hooks[i]->hook_name, PRESTART_HOOK)) { ++ if (strcmp(e->hooks[i]->hook_name, PRESTART_HOOK) == 0) { + ret = spec_add_prestart_hook(spec, oci_hook); +- } else if (strcmp(e->hooks[i]->hook_name, POSTSTART_HOOK)) { ++ } else if (strcmp(e->hooks[i]->hook_name, POSTSTART_HOOK) == 0) { + ret = spec_add_poststart_hook(spec, oci_hook); +- } else if (strcmp(e->hooks[i]->hook_name, POSTSTOP_HOOK)) { ++ } else if (strcmp(e->hooks[i]->hook_name, POSTSTOP_HOOK) == 0) { + ret = spec_add_poststop_hook(spec, oci_hook); + } else { + /* +-- +2.43.0 + diff --git a/iSulad.spec b/iSulad.spec index 5cf31d3..fce6494 100644 --- a/iSulad.spec +++ b/iSulad.spec @@ -1,5 +1,5 @@ %global _version 2.1.5 -%global _release 20 +%global _release 21 %global is_systemd 1 %global enable_criv1 1 %global enable_cdi 1 @@ -223,6 +223,7 @@ Patch0198: 0198-isolate-isula-search-ut-in-registry_images_ut.patch Patch0199: 0199-move-sandbox-network_ready-from-metadata-to-state-fo.patch Patch0200: 0200-clean-sandbox-when-create-failed-to-be-consisent-wit.patch Patch0201: 0201-bugfix-SandboxAPI-heap-buffer-overflow-when-containe.patch +Patch0202: 0202-bugfix-fix-cdi-hook-name-strcmp-error.patch %ifarch x86_64 aarch64 Provides: libhttpclient.so()(64bit) @@ -493,6 +494,12 @@ fi %endif %changelog +* Mon May 19 2025 dongyuzhen - 2.1.5-21 +- Type:enhancement +- CVE:NA +- SUG:NA +- DESC:sync patch from upstream + * Fri May 16 2025 dongyuzhen - 2.1.5-20 - Type:enhancement - CVE:NA -- Gitee