diff --git a/Revert-selinux-adapt-to-libselinux.patch b/Revert-selinux-adapt-to-libselinux.patch new file mode 100644 index 0000000000000000000000000000000000000000..9f5e6ae08c3ac34b2866c85573fe8c331e96df77 --- /dev/null +++ b/Revert-selinux-adapt-to-libselinux.patch @@ -0,0 +1,36 @@ +From 3dc1e0f37c013c317f3e868d1e4a6668d8f18a03 Mon Sep 17 00:00:00 2001 +From: mayunlong +Date: Wed, 9 Aug 2023 20:51:37 +0800 +Subject: [PATCH] Revert "selinux: adapt to libselinux" + +use the solution modified by the upstream community torevert this patch +This reverts commit 20fd0fb6b915363efecd2d108363995d8dea8e1a. +--- + src/security/security_selinux.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c +index cb4dc3e101..c91c7ca484 100644 +--- a/src/security/security_selinux.c ++++ b/src/security/security_selinux.c +@@ -541,7 +541,7 @@ static char * + virSecuritySELinuxContextAddRange(char *src, + char *dst) + { +- const char *str = NULL; ++ char *str = NULL; + char *ret = NULL; + context_t srccon = NULL; + context_t dstcon = NULL; +@@ -582,7 +582,7 @@ virSecuritySELinuxGenNewContext(const char *basecontext, + { + context_t context = NULL; + char *ret = NULL; +- const char *str; ++ char *str; + char *ourSecContext = NULL; + context_t ourContext = NULL; + +-- +2.41.0.windows.1 + diff --git a/fix-error-in-printf-format-string.patch b/fix-error-in-printf-format-string.patch new file mode 100644 index 0000000000000000000000000000000000000000..78edba3e6614031ba36d9bf14b38247cdc13ef07 --- /dev/null +++ b/fix-error-in-printf-format-string.patch @@ -0,0 +1,32 @@ +From 56dc1a61719f5133b30676afe71c4d1482c84476 Mon Sep 17 00:00:00 2001 +From: Zhenyu Ye +Date: Thu, 19 Aug 2021 20:14:11 +0800 +Subject: [PATCH] fix error in printf format string + +Use %s to print NULLSTR(duri). + +Reported-by: Peng Liang +Signed-off-by: Zhenyu Ye +Reviewed-by: Michal Privoznik +Signed-off-by: zhujun2 +(cherry-pick from 94ac9d55fd9067326c483372c858bb4233826880) +--- + src/libvirt-domain.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c +index 6ce4a6715c..8f6ff2fe22 100644 +--- a/src/libvirt-domain.c ++++ b/src/libvirt-domain.c +@@ -4086,7 +4086,7 @@ virDomainMigrateToURI(virDomainPtr domain, + const char *dconnuri = NULL; + const char *miguri = NULL; + +- VIR_DOMAIN_DEBUG(domain, "duri=%p, flags=0x%lx, dname=%s, bandwidth=%lu", ++ VIR_DOMAIN_DEBUG(domain, "duri=%s, flags=0x%lx, dname=%s, bandwidth=%lu", + NULLSTR(duri), flags, NULLSTR(dname), bandwidth); + + virResetLastError(); +-- +2.41.0.windows.1 + diff --git a/libvirt.spec b/libvirt.spec index 126d745550c684fe6e518f1a08c929ae5c3e464c..77e0a22480815bd15b5bb45885a23cb78c08ba00 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -101,7 +101,7 @@ Summary: Library providing a simple virtualization API Name: libvirt Version: 6.2.0 -Release: 58 +Release: 59 License: LGPLv2+ URL: https://libvirt.org/ @@ -484,6 +484,11 @@ Patch0371: cpu_topo-support-for-cpu_topo-clusters-in-conf.patch Patch0372: cpu_topo-support-for-specifying-clusters-in-qemu-com.patch Patch0373: cpu_topo-support-for-reporting-cluster_id-in-NUMA-to.patch Patch0374: cpu_topo-fix-detection-of-vCPU-pids-when-multiple-cl.patch +Patch0375: fix-error-in-printf-format-string.patch +Patch0376: selinux-adapt-to-libselinux.patch +Patch0377: Revert-selinux-adapt-to-libselinux.patch +Patch0378: selinux-Reflect-context_str-type-change.patch +Patch0379: virnetsshsession-Adapt-to-change-libssh2-API.patch Requires: libvirt-daemon = %{version}-%{release} Requires: libvirt-daemon-config-network = %{version}-%{release} @@ -2220,6 +2225,13 @@ exit 0 %changelog +* Wed Aug 9 2023 Jiabo Feng - 6.2.0-59 +- virnetsshsession: Adapt to change libssh2 API +- selinux: Reflect context_str() type change +- Revert "selinux: adapt to libselinux" +- selinux: adapt to libselinux +- fix error in printf format string + * Tue May 23 2023 laokz - 6.2.0-58 - add riscv64 support diff --git a/selinux-Reflect-context_str-type-change.patch b/selinux-Reflect-context_str-type-change.patch new file mode 100644 index 0000000000000000000000000000000000000000..2ec7f9586817b3d304aa15b06a9256fbb21d7c6d --- /dev/null +++ b/selinux-Reflect-context_str-type-change.patch @@ -0,0 +1,44 @@ +From 77403dd65dad4cc81a7f237642ff40d87479ae73 Mon Sep 17 00:00:00 2001 +From: mayunlong +Date: Wed, 9 Aug 2023 21:03:21 +0800 +Subject: [PATCH] selinux: Reflect context_str() type change +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +As of [1]. libselinux changed the type of context_str() - it now +returns a const string. Follow this change in our code base. + +1: https://github.com/SELinuxProject/selinux/commit/dd98fa322766760c4e1f029cf19d2515a583304f + +Signed-off-by: Michal Privoznik +Reviewed-by: Ján Tomko +--- + src/security/security_selinux.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c +index c91c7ca484..cb4dc3e101 100644 +--- a/src/security/security_selinux.c ++++ b/src/security/security_selinux.c +@@ -541,7 +541,7 @@ static char * + virSecuritySELinuxContextAddRange(char *src, + char *dst) + { +- char *str = NULL; ++ const char *str = NULL; + char *ret = NULL; + context_t srccon = NULL; + context_t dstcon = NULL; +@@ -582,7 +582,7 @@ virSecuritySELinuxGenNewContext(const char *basecontext, + { + context_t context = NULL; + char *ret = NULL; +- char *str; ++ const char *str; + char *ourSecContext = NULL; + context_t ourContext = NULL; + +-- +2.41.0.windows.1 + diff --git a/selinux-adapt-to-libselinux.patch b/selinux-adapt-to-libselinux.patch new file mode 100644 index 0000000000000000000000000000000000000000..e6e188a29feadda3f154e59a2b339da167b71411 --- /dev/null +++ b/selinux-adapt-to-libselinux.patch @@ -0,0 +1,39 @@ +From 20fd0fb6b915363efecd2d108363995d8dea8e1a Mon Sep 17 00:00:00 2001 +From: mayunlong +Date: Wed, 9 Aug 2023 16:20:46 +0800 +Subject: [PATCH] selinux: adapt to libselinux + +After libselinux is upgranded to version 3.5, +the function context_str returns "const char *". +As a result, the build fails. Now fix it. + +Signed-off-by:mayunlong +--- + src/security/security_selinux.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c +index c91c7ca484..cb4dc3e101 100644 +--- a/src/security/security_selinux.c ++++ b/src/security/security_selinux.c +@@ -541,7 +541,7 @@ static char * + virSecuritySELinuxContextAddRange(char *src, + char *dst) + { +- char *str = NULL; ++ const char *str = NULL; + char *ret = NULL; + context_t srccon = NULL; + context_t dstcon = NULL; +@@ -582,7 +582,7 @@ virSecuritySELinuxGenNewContext(const char *basecontext, + { + context_t context = NULL; + char *ret = NULL; +- char *str; ++ const char *str; + char *ourSecContext = NULL; + context_t ourContext = NULL; + +-- +2.41.0.windows.1 + diff --git a/virnetsshsession-Adapt-to-change-libssh2-API.patch b/virnetsshsession-Adapt-to-change-libssh2-API.patch new file mode 100644 index 0000000000000000000000000000000000000000..dab79924c8c859b4d6492187eff68808f272a7c2 --- /dev/null +++ b/virnetsshsession-Adapt-to-change-libssh2-API.patch @@ -0,0 +1,36 @@ +From a2588d430c3dea3c4c259adc9d54d48891712c42 Mon Sep 17 00:00:00 2001 +From: mayunlong +Date: Wed, 9 Aug 2023 21:11:41 +0800 +Subject: [PATCH] virnetsshsession: Adapt to change libssh2 API + +In one of its commits [1] libssh2 changed the 'text' member of +LIBSSH2_USERAUTH_KBDINT_PROMPT struct from 'char' to 'unsigned +char'. But we g_strdup() the member in order to fill 'prompt' +member of virConnectCredential struct. Typecast the value to +avoid warnings. Also, drop @prompt variable, as it's needless. + +1: https://github.com/libssh2/libssh2/commit/83853f8aea0e2f739cacd491632eb7fd3d03ad2d +Signed-off-by: Michal Privoznik +Reviewed-by: Peter Krempa +--- + src/rpc/virnetsshsession.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/src/rpc/virnetsshsession.c b/src/rpc/virnetsshsession.c +index fabdc3ef22..e073f6dbf7 100644 +--- a/src/rpc/virnetsshsession.c ++++ b/src/rpc/virnetsshsession.c +@@ -230,9 +230,7 @@ virNetSSHKbIntCb(const char *name G_GNUC_UNUSED, + + /* fill data structures for auth callback */ + for (i = 0; i < num_prompts; i++) { +- char *prompt; +- prompt = g_strdup(prompts[i].text); +- askcred[i].prompt = prompt; ++ askcred[i].prompt = g_strdup((char *)prompts[i].text); + + /* remove colon and trailing spaces from prompts, as default behavior + * of libvirt's auth callback is to add them */ +-- +2.41.0.windows.1 +