From 123166b8c33f6aa3e292fee5025cba80f38374fd Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Sun, 28 Aug 2022 10:29:27 +0800 Subject: mcstrans: upgrade 3.3 -> 3.4 Refresh patches. Signed-off-by: Yi Zhao Signed-off-by: Joe MacDonald --- .../selinux/mcstrans/mcstrans-de-bashify.patch | 6 +-- .../mcstrans/mcstrans-fix-the-init-script.patch | 4 +- recipes-security/selinux/mcstrans_3.3.bb | 58 ---------------------- recipes-security/selinux/mcstrans_3.4.bb | 58 ++++++++++++++++++++++ 4 files changed, 63 insertions(+), 63 deletions(-) delete mode 100644 recipes-security/selinux/mcstrans_3.3.bb create mode 100644 recipes-security/selinux/mcstrans_3.4.bb diff --git a/recipes-security/selinux/mcstrans/mcstrans-de-bashify.patch b/recipes-security/selinux/mcstrans/mcstrans-de-bashify.patch index 27fd677..74ae879 100644 --- a/recipes-security/selinux/mcstrans/mcstrans-de-bashify.patch +++ b/recipes-security/selinux/mcstrans/mcstrans-de-bashify.patch @@ -1,4 +1,4 @@ -From 544b3c078374e5001e7fdc1b7d0b2eafda36f8fe Mon Sep 17 00:00:00 2001 +From 580a625e9e1266d92c248a5e3f471d12d42c149b Mon Sep 17 00:00:00 2001 From: Joe MacDonald Date: Fri, 7 Aug 2015 15:16:45 -0400 Subject: [PATCH] mcstrans: remove dependency on bash in initscript @@ -8,7 +8,7 @@ dependency on bash. Signed-off-by: Joe MacDonald -Upstream-Status: Pending +Upstream-Status: Inappropriate [embedded specific] Signed-off-by: Wenzong Fan Signed-off-by: Yi Zhao @@ -27,5 +27,5 @@ index 2804ec0..8b4737d 100644 # mcstransd This starts and stops mcstransd # -- -2.7.4 +2.25.1 diff --git a/recipes-security/selinux/mcstrans/mcstrans-fix-the-init-script.patch b/recipes-security/selinux/mcstrans/mcstrans-fix-the-init-script.patch index 79be090..a560722 100644 --- a/recipes-security/selinux/mcstrans/mcstrans-fix-the-init-script.patch +++ b/recipes-security/selinux/mcstrans/mcstrans-fix-the-init-script.patch @@ -1,4 +1,4 @@ -From 4d918a9679d2902ca2d41fe769a4d76f07a67b5f Mon Sep 17 00:00:00 2001 +From 123d5b6413905bfad535a072ff0ab5a495cb2a2a Mon Sep 17 00:00:00 2001 From: Roy Li Date: Wed, 6 Nov 2019 22:13:33 +0800 Subject: [PATCH] mcstrans: fix the init script @@ -28,5 +28,5 @@ index 8b4737d..86c89ea 100644 echo if test $RETVAL = 0 ; then -- -2.7.4 +2.25.1 diff --git a/recipes-security/selinux/mcstrans_3.3.bb b/recipes-security/selinux/mcstrans_3.3.bb deleted file mode 100644 index cd8780b..0000000 --- a/recipes-security/selinux/mcstrans_3.3.bb +++ /dev/null @@ -1,58 +0,0 @@ - -SUMMARY = "Daemon to translate SELinux MCS/MLS sensitivity labels" -DESCRIPTION = "\ -mcstrans provides an translation daemon to translate SELinux categories \ -from internal representations to user defined representation." -SECTION = "base" -LICENSE = "GPL-2.0-or-later" -LIC_FILES_CHKSUM = "file://${S}/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" - -require selinux_common.inc - -inherit systemd update-rc.d - -SRC_URI += "file://mcstrans-de-bashify.patch \ - file://mcstrans-fix-the-init-script.patch \ - " - -DEPENDS += "libsepol libselinux libcap" - -EXTRA_OEMAKE += "SBINDIR=${base_sbindir} \ - INITDIR=${sysconfdir}/init.d \ - SYSTEMDDIR=${systemd_unitdir} \ - " - -S = "${WORKDIR}/git/mcstrans" - -do_install:append() { - install -d ${D}${sbindir} - install -m 755 utils/untranscon ${D}${sbindir}/ - install -m 755 utils/transcon ${D}${sbindir}/ - - if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then - install -d ${D}${sysconfdir}/tmpfiles.d - echo "d ${localstatedir}/run/setrans - - - -" \ - > ${D}${sysconfdir}/tmpfiles.d/setrans.conf - else - install -d ${D}${sysconfdir}/default/volatiles - echo "d root root 0755 /var/run/setrans none" \ - >${D}${sysconfdir}/default/volatiles/80_mcstrans - fi - install -d ${D}${datadir}/mcstrans - cp -r share/* ${D}${datadir}/mcstrans/. -} - -SYSTEMD_SERVICE:mcstrans = "mcstrans.service" -INITSCRIPT_PACKAGES = "mcstrans" -INITSCRIPT_NAME:mcstrans = "mcstrans" -INITSCRIPT_PARAMS:mcstrans = "defaults" - -pkg_postinst:mcstrans () { - if [ -z "$D" ]; then - if command -v systemd-tmpfiles >/dev/null; then - systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/setrans.conf - elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then - ${sysconfdir}/init.d/populate-volatile.sh update - fi - fi -} diff --git a/recipes-security/selinux/mcstrans_3.4.bb b/recipes-security/selinux/mcstrans_3.4.bb new file mode 100644 index 0000000..b5d6b54 --- /dev/null +++ b/recipes-security/selinux/mcstrans_3.4.bb @@ -0,0 +1,58 @@ + +SUMMARY = "Daemon to translate SELinux MCS/MLS sensitivity labels" +DESCRIPTION = "\ +mcstrans provides an translation daemon to translate SELinux categories \ +from internal representations to user defined representation." +SECTION = "base" +LICENSE = "GPL-2.0-or-later" +LIC_FILES_CHKSUM = "file://${S}/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" + +require selinux_common.inc + +inherit pkgconfig systemd update-rc.d + +SRC_URI += "file://mcstrans-de-bashify.patch \ + file://mcstrans-fix-the-init-script.patch \ + " + +DEPENDS = "libsepol libselinux libcap" + +EXTRA_OEMAKE = "SBINDIR=${base_sbindir} \ + INITDIR=${sysconfdir}/init.d \ + SYSTEMDDIR=${systemd_unitdir} \ + " + +S = "${WORKDIR}/git/mcstrans" + +do_install:append() { + install -d ${D}${sbindir} + install -m 755 utils/untranscon ${D}${sbindir}/ + install -m 755 utils/transcon ${D}${sbindir}/ + + if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then + install -d ${D}${sysconfdir}/tmpfiles.d + echo "d ${localstatedir}/run/setrans - - - -" \ + > ${D}${sysconfdir}/tmpfiles.d/setrans.conf + else + install -d ${D}${sysconfdir}/default/volatiles + echo "d root root 0755 /var/run/setrans none" \ + >${D}${sysconfdir}/default/volatiles/80_mcstrans + fi + install -d ${D}${datadir}/mcstrans + cp -r share/* ${D}${datadir}/mcstrans/. +} + +SYSTEMD_SERVICE:mcstrans = "mcstrans.service" +INITSCRIPT_PACKAGES = "mcstrans" +INITSCRIPT_NAME:mcstrans = "mcstrans" +INITSCRIPT_PARAMS:mcstrans = "defaults" + +pkg_postinst:mcstrans () { + if [ -z "$D" ]; then + if command -v systemd-tmpfiles >/dev/null; then + systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/setrans.conf + elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then + ${sysconfdir}/init.d/populate-volatile.sh update + fi + fi +} -- cgit v1.2.3-54-g00ecf