similarity index 100%
rename from recipes-security/selinux/checkpolicy_3.10.bb
rename to recipes-security/selinux/checkpolicy_3.11.bb
similarity index 94%
rename from recipes-security/selinux/libselinux-python_3.10.bb
rename to recipes-security/selinux/libselinux-python_3.11.bb
@@ -14,13 +14,13 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/libselinux:"
SRC_URI += "\
file://0001-Makefile-fix-python-modules-install-path-for-multili.patch;patchdir=.. \
file://0002-Do-not-use-PYCEXT-and-rely-on-the-installed-file-nam.patch;patchdir=.. \
- file://0003-libselinux-restore-drop-the-obsolete-LSF-transitiona.patch;patchdir=.. \
file://0004-libselinux-Replace-PyString_FromString-with-PyUnicode.patch;patchdir=.. \
"
S = "${UNPACKDIR}/${BP}/libselinux"
-DEPENDS = "libsepol libpcre2 swig-native python3-setuptools-scm-native python3-pip-native"
+DEPENDS = "libsepol libpcre2 swig-native python3-setuptools-scm-native python3-pip-native \
+ python3-build-native python3-wheel-native"
DEPENDS:append:libc-musl = " fts"
RDEPENDS:${PN} = "libselinux python3-core python3-shell"
@@ -11,18 +11,15 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libselinux/src/Makefile b/libselinux/src/Makefile
-index 0dbba7f4..d8011c99 100644
+index 9ecdbd4d..5158959c 100644
--- a/libselinux/src/Makefile
+++ b/libselinux/src/Makefile
-@@ -198,7 +198,7 @@ ifneq ($(DISABLE_SHARED),y)
+@@ -196,7 +196,7 @@ ifneq ($(DISABLE_SHARED),y)
endif
install-pywrap: pywrap
-- CFLAGS="$(CPPFLAGS) $(CFLAGS) $(SWIG_CFLAGS)" $(PYTHON) -m pip install --no-build-isolation --prefix=$(PREFIX) `test -n "$(DESTDIR)" && echo --root $(DESTDIR) --ignore-installed --no-deps` $(PYTHON_SETUP_ARGS) .
-+ CFLAGS="$(CPPFLAGS) $(CFLAGS) $(SWIG_CFLAGS)" $(PYTHON) -m pip install --no-build-isolation --prefix=$(PREFIX) --root $(DESTDIR) --ignore-installed --no-deps $(PYTHON_SETUP_ARGS) .
+- $(PYTHON) -m pip install --no-build-isolation --force-reinstall --prefix=$(PREFIX) `test -n "$(DESTDIR)" && echo --root $(DESTDIR) --ignore-installed --no-deps` dist/*.whl
++ $(PYTHON) -m pip install --no-build-isolation --force-reinstall --prefix=$(PREFIX) --root $(DESTDIR) --ignore-installed --no-deps dist/*.whl
install -m 644 $(SWIGPYOUT) $(DESTDIR)$(PYTHONLIBDIR)/selinux/__init__.py
ln -sf --relative $(DESTDIR)$(PYTHONLIBDIR)/selinux/_selinux$(PYCEXT) $(DESTDIR)$(PYTHONLIBDIR)/_selinux$(PYCEXT)
-2.34.1
-
@@ -27,10 +27,9 @@ Signed-off-by: Changqing Li <changqing.li@windriver.com>
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/libselinux/src/Makefile b/libselinux/src/Makefile
-index d8011c99..c611422d 100644
--- a/libselinux/src/Makefile
+++ b/libselinux/src/Makefile
-@@ -15,7 +15,6 @@ INCLUDEDIR ?= $(PREFIX)/include
+@@ -18,7 +18,6 @@
PYINC ?= $(shell $(PKG_CONFIG) --cflags $(PYPREFIX))
PYLIBS ?= $(shell $(PKG_CONFIG) --libs $(PYPREFIX))
PYTHONLIBDIR ?= $(shell $(PYTHON) -c "import sysconfig; print(sysconfig.get_path('platlib', vars={'platbase': '$(PREFIX)', 'base': '$(PREFIX)'}))")
@@ -38,15 +37,12 @@ index d8011c99..c611422d 100644
RUBYINC ?= $(shell $(RUBY) -e 'puts "-I" + RbConfig::CONFIG["rubyarchhdrdir"] + " -I" + RbConfig::CONFIG["rubyhdrdir"]')
RUBYLIBS ?= $(shell $(RUBY) -e 'puts "-L" + RbConfig::CONFIG["libdir"] + " -L" + RbConfig::CONFIG["archlibdir"] + " " + RbConfig::CONFIG["LIBRUBYARG_SHARED"]')
RUBYINSTALL ?= $(shell $(RUBY) -e 'puts RbConfig::CONFIG["vendorarchdir"]')
-@@ -200,7 +199,7 @@ endif
+@@ -198,7 +197,7 @@
install-pywrap: pywrap
- CFLAGS="$(CPPFLAGS) $(CFLAGS) $(SWIG_CFLAGS)" $(PYTHON) -m pip install --no-build-isolation --prefix=$(PREFIX) --root $(DESTDIR) --ignore-installed --no-deps $(PYTHON_SETUP_ARGS) .
+ $(PYTHON) -m pip install --no-build-isolation --force-reinstall --prefix=$(PREFIX) --root $(DESTDIR) --ignore-installed --no-deps dist/*.whl
install -m 644 $(SWIGPYOUT) $(DESTDIR)$(PYTHONLIBDIR)/selinux/__init__.py
- ln -sf --relative $(DESTDIR)$(PYTHONLIBDIR)/selinux/_selinux$(PYCEXT) $(DESTDIR)$(PYTHONLIBDIR)/_selinux$(PYCEXT)
+ ln -sf --relative $(DESTDIR)$(PYTHONLIBDIR)/selinux/_selinux*.so $(DESTDIR)$(PYTHONLIBDIR)/
install-rubywrap: rubywrap
test -d $(DESTDIR)$(RUBYINSTALL) || install -m 755 -d $(DESTDIR)$(RUBYINSTALL)
-2.34.1
-
deleted file mode 100644
@@ -1,40 +0,0 @@
-From c4cb7a15e3f5c4081e3a459f15da3e58449cc4de Mon Sep 17 00:00:00 2001
-From: Renato Caldas <renato@calgera.com>
-Date: Thu, 29 Jun 2023 13:59:11 +0100
-Subject: [PATCH] libselinux: restore: drop the obsolete LSF transitional API.
-
-The preferred way to enable LSF support on 32 bit systems is to define
-_FILE_OFFSET_BITS=64 when building selinux.
-
-Upstream-Status: Submitted [https://github.com/SELinuxProject/selinux/pull/401]
-
-Signed-off-by: Renato Caldas <renato@calgera.com>
----
- libselinux/src/selinux_restorecon.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/libselinux/src/selinux_restorecon.c b/libselinux/src/selinux_restorecon.c
-index 8fadf4d2..f23bad0c 100644
---- a/libselinux/src/selinux_restorecon.c
-+++ b/libselinux/src/selinux_restorecon.c
-@@ -443,7 +443,7 @@ static int filespec_add(ino_t ino, const char *con, const char *file,
- file_spec_t *prevfl, *fl;
- uint32_t h;
- int ret;
-- struct stat64 sb;
-+ struct stat sb;
-
- __pthread_mutex_lock(&fl_mutex);
-
-@@ -457,7 +457,7 @@ static int filespec_add(ino_t ino, const char *con, const char *file,
- for (prevfl = &fl_head[h], fl = fl_head[h].next; fl;
- prevfl = fl, fl = fl->next) {
- if (ino == fl->ino) {
-- ret = lstat64(fl->file, &sb);
-+ ret = lstat(fl->file, &sb);
- if (ret < 0 || sb.st_ino != ino) {
- freecon(fl->con);
- free(fl->file);
-2.34.1
-
similarity index 86%
rename from recipes-security/selinux/libselinux_3.10.bb
rename to recipes-security/selinux/libselinux_3.11.bb
@@ -10,11 +10,6 @@ require selinux_common.inc
inherit lib_package pkgconfig
-FILESEXTRAPATHS:prepend := "${THISDIR}/libselinux:"
-SRC_URI += "\
- file://0003-libselinux-restore-drop-the-obsolete-LSF-transitiona.patch;patchdir=.. \
- "
-
DEPENDS = "libsepol libpcre2"
DEPENDS:append:libc-musl = " fts"
@@ -17,18 +17,15 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libsemanage/src/semanage_store.c b/libsemanage/src/semanage_store.c
-index 1731c5e8..c6ace295 100644
+index f14ebe97..2a50605f 100644
--- a/libsemanage/src/semanage_store.c
+++ b/libsemanage/src/semanage_store.c
-@@ -1445,7 +1445,7 @@ static int semanage_exec_prog(semanage_handle_t * sh,
+@@ -1505,7 +1505,7 @@ static int semanage_exec_prog(semanage_handle_t *sh, external_prog_t *e,
if (forkval == 0) {
/* child process. file descriptors will be closed
* because they were set as close-on-exec. */
- execve(e->path, argv, NULL);
+ execv(e->path, argv);
- _exit(EXIT_FAILURE); /* if execve() failed */
+ _exit(EXIT_FAILURE); /* if execve() failed */
}
-2.34.1
-
@@ -8,12 +8,12 @@ Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
---
libsemanage/src/Makefile | 10 +++++++++-
- libsemanage/src/seusers_local.c | 13 +++++++++++++
+ libsemanage/src/seusers_local.c | 10 ++++++++++
libsemanage/tests/Makefile | 10 +++++++++-
- 3 files changed, 31 insertions(+), 2 deletions(-)
+ 3 files changed, 28 insertions(+), 2 deletions(-)
diff --git a/libsemanage/src/Makefile b/libsemanage/src/Makefile
-index fa3449fb..66c3010f 100644
+index 63c1499c..f6f76f0d 100644
--- a/libsemanage/src/Makefile
+++ b/libsemanage/src/Makefile
@@ -27,6 +27,14 @@ ifeq ($(DEBUG),1)
@@ -31,17 +31,17 @@ index fa3449fb..66c3010f 100644
LEX = flex
LFLAGS = -s
YACC = bison
-@@ -93,7 +101,7 @@ $(LIBA): $(OBJS)
+@@ -98,7 +106,7 @@ $(LIBA): $(OBJS)
$(RANLIB) $@
$(LIBSO): $(LOBJS)
-- $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -L../../libselinux/src -lsepol -laudit -lselinux -lbz2 -Wl,-soname,$(LIBSO),--version-script=libsemanage.map,-z,defs
-+ $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -L../../libselinux/src -lsepol $(LIBAUDIT) -lselinux -lbz2 -Wl,-soname,$(LIBSO),--version-script=libsemanage.map,-z,defs
+- $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -fPIC -shared -o $@ $^ -L../../libselinux/src -lsepol -laudit -lselinux -lbz2 -Wl,-soname,$(LIBSO),--version-script=libsemanage.map,-z,defs
++ $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -fPIC -shared -o $@ $^ -L../../libselinux/src -lsepol $(LIBAUDIT) -lselinux -lbz2 -Wl,-soname,$(LIBSO),--version-script=libsemanage.map,-z,defs
ln -sf $@ $(TARGET)
$(LIBPC): $(LIBPC).in ../VERSION
diff --git a/libsemanage/src/seusers_local.c b/libsemanage/src/seusers_local.c
-index eb3f82bc..45da8257 100644
+index 865fe461..b959154c 100644
--- a/libsemanage/src/seusers_local.c
+++ b/libsemanage/src/seusers_local.c
@@ -8,7 +8,11 @@ typedef struct semanage_seuser record_t;
@@ -56,44 +56,43 @@ index eb3f82bc..45da8257 100644
#include <errno.h>
#include "user_internal.h"
#include "seuser_internal.h"
-@@ -56,6 +60,7 @@ static char *semanage_user_roles(semanage_handle_t * handle, const char *sename)
+@@ -57,6 +61,7 @@ static char *semanage_user_roles(semanage_handle_t *handle, const char *sename)
return roles;
}
+#ifndef DISABLE_AUDIT
- static int semanage_seuser_audit(semanage_handle_t * handle,
- const semanage_seuser_t * seuser,
- const semanage_seuser_t * previous,
-@@ -120,6 +125,7 @@ err:
+ static int semanage_seuser_audit(semanage_handle_t *handle,
+ const semanage_seuser_t *seuser,
+ const semanage_seuser_t *previous,
+@@ -123,6 +128,7 @@ err:
free(proles);
return rc;
}
+#endif
- int semanage_seuser_modify_local(semanage_handle_t * handle,
- const semanage_seuser_key_t * key,
-@@ -165,8 +171,11 @@ int semanage_seuser_modify_local(semanage_handle_t * handle,
- (void) semanage_seuser_query(handle, key, &previous);
+ int semanage_seuser_modify_local(semanage_handle_t *handle,
+ const semanage_seuser_key_t *key,
+@@ -170,9 +176,11 @@ int semanage_seuser_modify_local(semanage_handle_t *handle,
+ (void)semanage_seuser_query(handle, key, &previous);
handle->msg_callback = callback;
rc = dbase_modify(handle, dconfig, key, new);
-+
+#ifndef DISABLE_AUDIT
- if (semanage_seuser_audit(handle, new, previous, AUDIT_ROLE_ASSIGN, rc == 0) < 0)
+ if (semanage_seuser_audit(handle, new, previous, AUDIT_ROLE_ASSIGN,
+ rc == 0) < 0)
rc = -1;
+#endif
err:
if (previous)
semanage_seuser_free(previous);
-@@ -182,8 +191,12 @@ int semanage_seuser_del_local(semanage_handle_t * handle,
+@@ -188,9 +196,11 @@ int semanage_seuser_del_local(semanage_handle_t *handle,
dbase_config_t *dconfig = semanage_seuser_dbase_local(handle);
rc = dbase_del(handle, dconfig, key);
semanage_seuser_query(handle, key, &seuser);
-+
+#ifndef DISABLE_AUDIT
- if (semanage_seuser_audit(handle, NULL, seuser, AUDIT_ROLE_REMOVE, rc == 0) < 0)
+ if (semanage_seuser_audit(handle, NULL, seuser, AUDIT_ROLE_REMOVE,
+ rc == 0) < 0)
rc = -1;
+#endif
-+
if (seuser)
semanage_seuser_free(seuser);
return rc;
@@ -121,6 +120,3 @@ index 241ff17a..fa03fb66 100644
OBJECTS = $(SOURCES:.c=.o)
POLICIES = $(CILS:.cil=.policy)
-2.34.1
-
similarity index 100%
rename from recipes-security/selinux/libsemanage_3.10.bb
rename to recipes-security/selinux/libsemanage_3.11.bb
similarity index 100%
rename from recipes-security/selinux/libsepol_3.10.bb
rename to recipes-security/selinux/libsepol_3.11.bb
similarity index 100%
rename from recipes-security/selinux/mcstrans_3.10.bb
rename to recipes-security/selinux/mcstrans_3.11.bb
similarity index 100%
rename from recipes-security/selinux/policycoreutils_3.10.bb
rename to recipes-security/selinux/policycoreutils_3.11.bb
similarity index 100%
rename from recipes-security/selinux/restorecond_3.10.bb
rename to recipes-security/selinux/restorecond_3.11.bb
similarity index 100%
rename from recipes-security/selinux/secilc_3.10.bb
rename to recipes-security/selinux/secilc_3.11.bb
similarity index 100%
rename from recipes-security/selinux/selinux-dbus_3.10.bb
rename to recipes-security/selinux/selinux-dbus_3.11.bb
similarity index 100%
rename from recipes-security/selinux/selinux-gui_3.10.bb
rename to recipes-security/selinux/selinux-gui_3.11.bb
@@ -13,18 +13,15 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/python/sepolicy/Makefile b/python/sepolicy/Makefile
-index 1a26cfdc..6e40691d 100644
+index 51812980..33a595d1 100644
--- a/python/sepolicy/Makefile
+++ b/python/sepolicy/Makefile
-@@ -27,7 +27,7 @@ test:
+@@ -26,7 +26,7 @@ test:
@$(PYTHON) test_sepolicy.py -v
- install:
-- $(PYTHON) -m pip install --prefix=$(PREFIX) `test -n "$(DESTDIR)" && echo --root $(DESTDIR) --ignore-installed --no-deps` $(PYTHON_SETUP_ARGS) .
-+ $(PYTHON) -m pip install --prefix=$(PREFIX) --root $(DESTDIR) --ignore-installed --no-deps $(PYTHON_SETUP_ARGS) .
+ install: python-build
+- $(PYTHON) -m pip install --no-build-isolation --force-reinstall --prefix=$(PREFIX) `test -n "$(DESTDIR)" && echo --root $(DESTDIR) --ignore-installed --no-deps` dist/*.whl
++ $(PYTHON) -m pip install --no-build-isolation --force-reinstall --prefix=$(PREFIX) --root $(DESTDIR) --ignore-installed --no-deps dist/*.whl
[ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR)
install -m 755 sepolicy.py $(DESTDIR)$(BINDIR)/sepolicy
(cd $(DESTDIR)$(BINDIR); ln -sf sepolicy sepolgen)
-2.34.1
-
deleted file mode 100644
@@ -1,61 +0,0 @@
-From 845f081ba3dab6c27aeac12ab20a45250fd9a8e6 Mon Sep 17 00:00:00 2001
-From: Yi Zhao <yi.zhao@windriver.com>
-Date: Tue, 24 Sep 2024 14:07:41 +0800
-Subject: [PATCH] sepolicy: set conf.substitutions['releasever'] to empty str
- when releasever is None
-
-For some distributions (e.g. Yocto) that do not provide
-system-release/distribution-release file, libdnf can not get releasever
-variable, causing conf.substitutions['releasever'] to not be set.
-This will cause 'sepolicy generate' command to fail with the following
-error on these distributions:
-
-$ sepolicy generate --init /usr/local/bin/foo
-Traceback (most recent call last):
- File "/usr/bin/sepolicy", line 702, in <module>
- args.func(args)
- File "/usr/bin/sepolicy", line 569, in generate
- mypolicy.gen_writeable()
- File "/usr/lib/python3.12/site-packages/sepolicy/generate.py", line 1302, in gen_writeable
- self.__extract_rpms()
- File "/usr/lib/python3.12/site-packages/sepolicy/generate.py", line 1268, in __extract_rpms
- base.read_all_repos()
- File "/usr/lib/python3.12/site-packages/dnf/base.py", line 554, in read_all_repos
- for repo in reader:
- ^^^^^^
- File "/usr/lib/python3.12/site-packages/dnf/conf/read.py", line 42, in __iter__
- for r in self._get_repos(self.conf.config_file_path):
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- File "/usr/lib/python3.12/site-packages/dnf/conf/read.py", line 109, in _get_repos
- parser.setSubstitutions(substs)
- File "/usr/lib/python3.12/site-packages/libdnf/conf.py", line 1643, in setSubstitutions
- return _conf.ConfigParser_setSubstitutions(self, substitutions)
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-TypeError: in method 'ConfigParser_setSubstitutions', argument 2 of type 'std::map< std::string,std::string,std::less< std::string >,std::allocator< std::pair< std::string const,std::string > > > const &'
-
-Set conf.substitutions['releasever'] to empty str if releasever is None.
-
-Upstream-Status: Submitted [https://github.com/SELinuxProject/selinux/pull/444]
-
-Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
----
- python/sepolicy/sepolicy/generate.py | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/python/sepolicy/sepolicy/generate.py b/python/sepolicy/sepolicy/generate.py
-index adf65f27..56923dc4 100644
---- a/python/sepolicy/sepolicy/generate.py
-+++ b/python/sepolicy/sepolicy/generate.py
-@@ -1265,6 +1265,9 @@ allow %s_t %s_t:%s_socket name_%s;
- import dnf
-
- with dnf.Base() as base:
-+ if base.conf.substitutions.get('releasever') is None:
-+ base.conf.substitutions['releasever'] = ''
-+
- base.read_all_repos()
- base.fill_sack(load_system_repo=True)
-
-2.34.1
-
similarity index 96%
rename from recipes-security/selinux/selinux-python_3.10.bb
rename to recipes-security/selinux/selinux-python_3.11.bb
@@ -11,12 +11,12 @@ require selinux_common.inc
inherit python3targetconfig
SRC_URI += "file://0001-sepolicy-fix-install-path-for-new-pymodule-sepolicy.patch;patchdir=.. \
- file://0002-sepolicy-set-conf.substitutions-releasever-to-empty-.patch;patchdir=.. \
"
S = "${UNPACKDIR}/${BP}/python"
-DEPENDS = "libsepol libselinux gettext-native python3-setuptools-scm-native python3-pip-native"
+DEPENDS = "libsepol libselinux gettext-native python3-setuptools-scm-native python3-pip-native \
+ python3-build-native python3-wheel-native"
RDEPENDS:${PN} = "\
python3-core \
similarity index 100%
rename from recipes-security/selinux/selinux-sandbox_3.10.bb
rename to recipes-security/selinux/selinux-sandbox_3.11.bb
@@ -1,7 +1,7 @@
HOMEPAGE = "https://github.com/SELinuxProject"
SRC_URI = "git://github.com/SELinuxProject/selinux.git;branch=main;protocol=https"
-SRCREV = "ca10fc4204ed60540d41d2499127c18ad0643f9e"
+SRCREV = "2233a23a4d4f1bf29054037babec13f30d038e65"
require conf/selinux_refpolicy_common.inc
similarity index 100%
rename from recipes-security/selinux/semodule-utils_3.10.bb
rename to recipes-security/selinux/semodule-utils_3.11.bb