summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYi Zhao <yi.zhao@windriver.com>2024-12-10 21:12:54 +0800
committerJoe MacDonald <joe.macdonald@siemens.com>2024-12-10 12:39:38 -0500
commitc3527f5859779610b373be3f964f7c32de39a3e0 (patch)
tree81c6ca10eff4b08a1bd9c12ee49aed2a8f222533
parent51bfd7c35a1dfaeef31a1de276061b9638f6a444 (diff)
downloadmeta-selinux-c3527f5859779610b373be3f964f7c32de39a3e0.tar.gz
libselinux-python: fix build with swig 4.3
Backport a patch to fix build with swig 4.3[1]. [1] https://github.com/SELinuxProject/selinux/issues/447 Signed-off-by: Yi Zhao <yi.zhao@windriver.com> Signed-off-by: Joe MacDonald <joe.macdonald@siemens.com>
-rw-r--r--recipes-security/selinux/libselinux-python_3.7.bb1
-rw-r--r--recipes-security/selinux/libselinux/0001-libselinux-fix-swig-bindings-for-4.3.0.patch91
2 files changed, 92 insertions, 0 deletions
diff --git a/recipes-security/selinux/libselinux-python_3.7.bb b/recipes-security/selinux/libselinux-python_3.7.bb
index 3c5c489..5099e55 100644
--- a/recipes-security/selinux/libselinux-python_3.7.bb
+++ b/recipes-security/selinux/libselinux-python_3.7.bb
@@ -15,6 +15,7 @@ SRC_URI += "\
15 file://0001-Makefile-fix-python-modules-install-path-for-multili.patch \ 15 file://0001-Makefile-fix-python-modules-install-path-for-multili.patch \
16 file://0002-Do-not-use-PYCEXT-and-rely-on-the-installed-file-nam.patch \ 16 file://0002-Do-not-use-PYCEXT-and-rely-on-the-installed-file-nam.patch \
17 file://0003-libselinux-restore-drop-the-obsolete-LSF-transitiona.patch \ 17 file://0003-libselinux-restore-drop-the-obsolete-LSF-transitiona.patch \
18 file://0001-libselinux-fix-swig-bindings-for-4.3.0.patch \
18 " 19 "
19 20
20S = "${WORKDIR}/git/libselinux" 21S = "${WORKDIR}/git/libselinux"
diff --git a/recipes-security/selinux/libselinux/0001-libselinux-fix-swig-bindings-for-4.3.0.patch b/recipes-security/selinux/libselinux/0001-libselinux-fix-swig-bindings-for-4.3.0.patch
new file mode 100644
index 0000000..277c36c
--- /dev/null
+++ b/recipes-security/selinux/libselinux/0001-libselinux-fix-swig-bindings-for-4.3.0.patch
@@ -0,0 +1,91 @@
1From 8e0e718bae53fff30831b92cd784151d475a20da Mon Sep 17 00:00:00 2001
2From: Petr Lautrbach <lautrbach@redhat.com>
3Date: Wed, 16 Oct 2024 20:48:11 +0200
4Subject: [PATCH] libselinux: fix swig bindings for 4.3.0
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9https://github.com/swig/swig/blob/master/CHANGES.current
10
11"[Python] #2907 Fix returning null from functions with output
12parameters. Ensures OUTPUT and INOUT typemaps are handled
13consistently wrt return type.
14
15New declaration of SWIG_Python_AppendOutput is now:
16
17 SWIG_Python_AppendOutput(PyObject* result, PyObject* obj, int is_void);
18
19The 3rd parameter is new and the new $isvoid special variable
20should be passed to it, indicating whether or not the wrapped
21function returns void.
22
23Also consider replacing with:
24
25 SWIG_AppendOutput(PyObject* result, PyObject* obj);
26
27which calls SWIG_Python_AppendOutput with same parameters but adding $isvoid
28for final parameter."
29
30Fixes: https://github.com/SELinuxProject/selinux/issues/447
31
32 selinuxswig_python_wrap.c: In function ‘_wrap_security_compute_user’:
33 selinuxswig_python_wrap.c:11499:17: error: too few arguments to function ‘SWIG_Python_AppendOutput’
34 11499 | resultobj = SWIG_Python_AppendOutput(resultobj, plist);
35 | ^~~~~~~~~~~~~~~~~~~~~~~~
36 selinuxswig_python_wrap.c:1248:1: note: declared here
37 1248 | SWIG_Python_AppendOutput(PyObject* result, PyObject* obj, int is_void) {
38 | ^~~~~~~~~~~~~~~~~~~~~~~~
39 selinuxswig_python_wrap.c: In function ‘_wrap_security_compute_user_raw’:
40 selinuxswig_python_wrap.c:11570:17: error: too few arguments to function ‘SWIG_Python_AppendOutput’
41 11570 | resultobj = SWIG_Python_AppendOutput(resultobj, plist);
42 | ^~~~~~~~~~~~~~~~~~~~~~~~
43 selinuxswig_python_wrap.c:1248:1: note: declared here
44 1248 | SWIG_Python_AppendOutput(PyObject* result, PyObject* obj, int is_void) {
45 | ^~~~~~~~~~~~~~~~~~~~~~~~
46 selinuxswig_python_wrap.c: In function ‘_wrap_security_get_boolean_names’:
47 selinuxswig_python_wrap.c:12470:17: error: too few arguments to function ‘SWIG_Python_AppendOutput’
48 12470 | resultobj = SWIG_Python_AppendOutput(resultobj, list);
49 | ^~~~~~~~~~~~~~~~~~~~~~~~
50 selinuxswig_python_wrap.c:1248:1: note: declared here
51 1248 | SWIG_Python_AppendOutput(PyObject* result, PyObject* obj, int is_void) {
52 | ^~~~~~~~~~~~~~~~~~~~~~~~
53 error: command '/usr/bin/gcc' failed with exit code 1
54
55Suggested-by: Jitka Plesnikova <jplesnik@redhat.com>
56Signed-off-by: Petr Lautrbach <lautrbach@redhat.com>
57Acked-by: James Carter <jwcart2@gmail.com>
58
59Upstream-Status: Backport
60[https://github.com/SELinuxProject/selinux/commit/8e0e718bae53fff30831b92cd784151d475a20da]
61
62Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
63---
64 src/selinuxswig_python.i | 4 ++--
65 1 file changed, 2 insertions(+), 2 deletions(-)
66
67diff --git a/src/selinuxswig_python.i b/src/selinuxswig_python.i
68index 17e03b9e..03ed296d 100644
69--- a/src/selinuxswig_python.i
70+++ b/src/selinuxswig_python.i
71@@ -71,7 +71,7 @@ def install(src, dest):
72 for (i = 0; i < *$2; i++) {
73 PyList_SetItem(list, i, PyString_FromString((*$1)[i]));
74 }
75- $result = SWIG_Python_AppendOutput($result, list);
76+ $result = SWIG_AppendOutput($result, list);
77 }
78
79 /* return a sid along with the result */
80@@ -108,7 +108,7 @@ def install(src, dest):
81 plist = PyList_New(0);
82 }
83
84- $result = SWIG_Python_AppendOutput($result, plist);
85+ $result = SWIG_AppendOutput($result, plist);
86 }
87
88 /* Makes functions in get_context_list.h return a Python list of contexts */
89--
902.25.1
91