diff options
author | V3n3RiX <venerix@koprulu.sector> | 2023-10-06 23:58:42 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2023-10-06 23:58:42 +0100 |
commit | 992d51a146d493f8dd5d710e033427d323b9c739 (patch) | |
tree | 8463bd925b241d603b8a754ce50fd81e46ed7b86 /sec-policy/selinux-base | |
parent | 8368c614e6a1232f34a14cd6495cf2f68933030d (diff) |
gentoo auto-resync : 06:10:2023 - 23:58:42
Diffstat (limited to 'sec-policy/selinux-base')
-rw-r--r-- | sec-policy/selinux-base/Manifest | 3 | ||||
-rw-r--r-- | sec-policy/selinux-base/selinux-base-2.20231002-r1.ebuild | 158 |
2 files changed, 161 insertions, 0 deletions
diff --git a/sec-policy/selinux-base/Manifest b/sec-policy/selinux-base/Manifest index eb34442b3bd7..17f0203df5d3 100644 --- a/sec-policy/selinux-base/Manifest +++ b/sec-policy/selinux-base/Manifest @@ -2,8 +2,11 @@ AUX config 631 BLAKE2B 7c7c5ad7e2349cf8dd6877bba7947f256b6bdee492ef76a44ac378eaf AUX selinux.conf 119 BLAKE2B c877aec601cfc066b42493a3b45e179834d30b7f0eb34b625f3758795c2fd2e58744cf539fdb5b06c002365fb264bdf6e953c1f6e30c7b2d310e22206ea5a37f SHA512 a057f84388b2b494b5e7623b076450c1856687c50a4ccb5aa22215748461786a0c71fdd9f76e9ed8639bcd3040006fb010aa5497192d6c0cab432a1b9c028b3b DIST patchbundle-selinux-base-policy-2.20221101-r3.tar.bz2 444710 BLAKE2B e33cc01a8be5a354e022be1e8bf242883b09b15ead0673f859819f5e668f18773a16527f2e608878e6976695dcb2890c55658e77877e93c716ae0b2dd2ed5a9b SHA512 52e60b22346903a6fead95c9fb348fa1d4037b7dcd3e5781248a7dfc426c8c3fced258fd22762c779a5f436d8be21eaed5425ed36ff99c267daae5e1cb9c8e7f DIST patchbundle-selinux-base-policy-2.20221101-r4.tar.bz2 457886 BLAKE2B 1e085f9f1739e0640c5eafa70db4c7ec19bca887c682ca2312a457fa57ee3eb176d0c8f16c2f84a1a026669b1240be3ff69066bd825c92fad75dcd2c13739f6c SHA512 da3ba1f076c04746719698aedb3aad48eb7c8a09df95c314b36f7a052538a07d893be413f35f4c34b01c1bf967ebe35ff32c2cea0722fe74a6e089a9d6aa47a6 +DIST patchbundle-selinux-base-policy-2.20231002-r1.tar.bz2 434734 BLAKE2B f2f28674ba93cd3a699cf0bc8fd06ab0500995f9518082cc76734c724b9ac82fcbcfa536f383a22b2fe72a9f781f202a78e630b7eb314880a98410badb32edd2 SHA512 30963590525842b7aaafc4bda99ae5297dc9706031431e69766dc90507357e4852ab0647893bfa27e6c6d82dd12f9af9a3fb5b790e2bd9b8311b8d91dafd083d DIST refpolicy-2.20221101.tar.bz2 583183 BLAKE2B 783d8af40fd77d7ddb848dba32e91921dd7c1380c094c45b719ada7b15f91aacbb52b410ffa6341f2f705ecbc9674b8570bd4867ce998e944fa0054ffd8bdf74 SHA512 29e5a29d90f714018c88fead2d5006ea90338fb5b7a1e4e98cb2e588c96cd861871d32176f6cc6f7c4e864ce5acae1aeed85d4c706ce2da8168986535baaf3a6 +DIST refpolicy-2.20231002.tar.bz2 600458 BLAKE2B 254d6d3d6b95f21e1f8e1df5822520ccaeade427053fb172079427cf70bd33f8ced87a9e09e1d36ec5f7b33f0bac8d730020d91996c6d25eafdcec66ebe35bb3 SHA512 029cd2225ce57d96f681720f24828e962320af41832ad2dc95d4d41d00dbde20bb08d91fa8b964b592812a9fedd908c261734b77ad72cccfde2de541b9c2c74d EBUILD selinux-base-2.20221101-r3.ebuild 4177 BLAKE2B 35e0e7bf6eb0fd9bc2fa42b2f4a3a7433c938125b3e9806acff36f10efc09ba88092a1732946e6ae305b3694486b58cb2fb02f5a4a3eabeb5264d600ddf51be9 SHA512 eaab5afeb094ab97db17f62c017f095453455c262efee3242bf7597273ca26e8646f771df1d797bba2302d44b9b0fff6d53bc9dbd9555f7900c0a0ce81e63cde EBUILD selinux-base-2.20221101-r4.ebuild 4177 BLAKE2B 35e0e7bf6eb0fd9bc2fa42b2f4a3a7433c938125b3e9806acff36f10efc09ba88092a1732946e6ae305b3694486b58cb2fb02f5a4a3eabeb5264d600ddf51be9 SHA512 eaab5afeb094ab97db17f62c017f095453455c262efee3242bf7597273ca26e8646f771df1d797bba2302d44b9b0fff6d53bc9dbd9555f7900c0a0ce81e63cde +EBUILD selinux-base-2.20231002-r1.ebuild 4181 BLAKE2B ae648cd52d008c82e7a617f6ea26df0193372b9fd6daa9783a020e9505b0e25bbbf9c1795c2230ad54e49fa6778b7790a18ceaf1a67163f03fad5d7f1edea38c SHA512 303be176036d04f6d4d44f2f1cf22bc3415516ca4421e1fd94c1a5932abe94b28b36c5b3f723c6a6df30c60ec13cdedd6234402cd1c5ff4fc5754174414f196a EBUILD selinux-base-9999.ebuild 4181 BLAKE2B ae648cd52d008c82e7a617f6ea26df0193372b9fd6daa9783a020e9505b0e25bbbf9c1795c2230ad54e49fa6778b7790a18ceaf1a67163f03fad5d7f1edea38c SHA512 303be176036d04f6d4d44f2f1cf22bc3415516ca4421e1fd94c1a5932abe94b28b36c5b3f723c6a6df30c60ec13cdedd6234402cd1c5ff4fc5754174414f196a MISC metadata.xml 745 BLAKE2B 7079a3d2e3455a9261439f607e4590fa2199ec642805127ab8f8b4876a1f642022f1ce636e6304db686baed0e05fc209007f2043e121618b31f1d0a4d23a3349 SHA512 9e17f2409d9ca252b2f2871e6a1028d1ec862c7ea27e0d0a10f07807061b4171f65d4b3673bc79451c0cd167944bcf78fcb37a7db43f66b2f21ff7f765aa8421 diff --git a/sec-policy/selinux-base/selinux-base-2.20231002-r1.ebuild b/sec-policy/selinux-base/selinux-base-2.20231002-r1.ebuild new file mode 100644 index 000000000000..11859691550d --- /dev/null +++ b/sec-policy/selinux-base/selinux-base-2.20231002-r1.ebuild @@ -0,0 +1,158 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="7" + +PYTHON_COMPAT=( python3_{9..11} ) +PYTHON_REQ_USE="xml(+)" +inherit python-any-r1 + +if [[ ${PV} == 9999* ]]; then + EGIT_REPO_URI="${SELINUX_GIT_REPO:-https://anongit.gentoo.org/git/proj/hardened-refpolicy.git}" + EGIT_BRANCH="${SELINUX_GIT_BRANCH:-master}" + EGIT_CHECKOUT_DIR="${WORKDIR}/refpolicy" + + inherit git-r3 +else + SRC_URI="https://github.com/SELinuxProject/refpolicy/releases/download/RELEASE_${PV/./_}/refpolicy-${PV}.tar.bz2 + https://dev.gentoo.org/~perfinion/patches/selinux-base-policy/patchbundle-selinux-base-policy-${PVR}.tar.bz2" + + KEYWORDS="~amd64 ~arm ~arm64 ~mips ~x86" +fi + +IUSE="doc +unknown-perms systemd +ubac +unconfined" + +DESCRIPTION="Gentoo base policy for SELinux" +HOMEPAGE="https://wiki.gentoo.org/wiki/Project:SELinux" +LICENSE="GPL-2" +SLOT="0" + +RDEPEND=">=sys-apps/policycoreutils-2.8" +DEPEND="${RDEPEND}" +BDEPEND=" + ${PYTHON_DEPS} + >=sys-apps/checkpolicy-2.8 + sys-devel/m4" + +S=${WORKDIR}/ + +src_prepare() { + if [[ ${PV} != 9999* ]]; then + einfo "Applying SELinux policy updates ... " + eapply -p0 "${WORKDIR}/0001-full-patch-against-stable-release.patch" + fi + + eapply_user + + cd "${S}/refpolicy" || die + emake bare +} + +src_configure() { + [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="targeted strict mls mcs" + + # Update the SELinux refpolicy capabilities based on the users' USE flags. + if use unknown-perms; then + sed -i -e '/^UNK_PERMS/s/deny/allow/' "${S}/refpolicy/build.conf" \ + || die "Failed to allow Unknown Permissions Handling" + sed -i -e '/^UNK_PERMS/s/deny/allow/' "${S}/refpolicy/Makefile" \ + || die "Failed to allow Unknown Permissions Handling" + fi + + if ! use ubac; then + sed -i -e '/^UBAC/s/y/n/' "${S}/refpolicy/build.conf" \ + || die "Failed to disable User Based Access Control" + fi + + if use systemd; then + sed -i -e '/^SYSTEMD/s/n/y/' "${S}/refpolicy/build.conf" \ + || die "Failed to enable SystemD" + fi + + echo "DISTRO = gentoo" >> "${S}/refpolicy/build.conf" || die + + # Prepare initial configuration + cd "${S}/refpolicy" || die + emake conf + + # Setup the policies based on the types delivered by the end user. + # These types can be "targeted", "strict", "mcs" and "mls". + for i in ${POLICY_TYPES}; do + cp -a "${S}/refpolicy" "${S}/${i}" || die + cd "${S}/${i}" || die + + sed -i -e "/= module/d" "${S}/${i}/policy/modules.conf" || die + + sed -i -e '/^QUIET/s/n/y/' -e "/^NAME/s/refpolicy/$i/" \ + "${S}/${i}/build.conf" || die "build.conf setup failed." + + if [[ "${i}" == "mls" ]] || [[ "${i}" == "mcs" ]]; + then + # MCS/MLS require additional settings + sed -i -e "/^TYPE/s/standard/${i}/" "${S}/${i}/build.conf" \ + || die "failed to set type to mls" + fi + + if [ "${i}" == "targeted" ]; then + sed -i -e '/root/d' -e 's/user_u/unconfined_u/' \ + "${S}/${i}/config/appconfig-standard/seusers" \ + || die "targeted seusers setup failed." + fi + + if [ "${i}" != "targeted" ] && [ "${i}" != "strict" ] && use unconfined; then + sed -i -e '/root/d' -e 's/user_u/unconfined_u/' \ + "${S}/${i}/config/appconfig-${i}/seusers" \ + || die "policy seusers setup failed." + fi + done +} + +src_compile() { + [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="targeted strict mls mcs" + + for i in ${POLICY_TYPES}; do + cd "${S}/${i}" || die + emake base + if use doc; then + emake html + fi + done +} + +src_install() { + [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="targeted strict mls mcs" + + for i in ${POLICY_TYPES}; do + cd "${S}/${i}" || die + + emake DESTDIR="${D}" install + emake DESTDIR="${D}" install-headers + + echo "run_init_t" > "${D}/etc/selinux/${i}/contexts/run_init_type" || die + + echo "textrel_shlib_t" >> "${D}/etc/selinux/${i}/contexts/customizable_types" || die + + # libsemanage won't make this on its own + keepdir "/etc/selinux/${i}/policy" + + if use doc; then + docinto ${i}/html + dodoc -r doc/html/*; + fi + + insinto /usr/share/selinux/devel; + doins doc/policy.xml; + + done + + docinto / + dodoc doc/Makefile.example doc/example.{te,fc,if} + + doman man/man8/*.8; + + insinto /etc/selinux + doins "${FILESDIR}/config" + + insinto /usr/share/portage/config/sets + doins "${FILESDIR}/selinux.conf" +} |