From 2f51c9978dda4c6e8debca43e4235ecc86914032 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 25 Dec 2017 17:37:52 +0000 Subject: gentoo resync : 25.12.2017 --- sec-policy/selinux-base/Manifest | 2 + .../selinux-base/selinux-base-2.20170805-r4.ebuild | 161 +++++++++++++++++++++ 2 files changed, 163 insertions(+) create mode 100644 sec-policy/selinux-base/selinux-base-2.20170805-r4.ebuild (limited to 'sec-policy/selinux-base') diff --git a/sec-policy/selinux-base/Manifest b/sec-policy/selinux-base/Manifest index 8cae1e2d58b2..0a7b3160b04d 100644 --- a/sec-policy/selinux-base/Manifest +++ b/sec-policy/selinux-base/Manifest @@ -6,6 +6,7 @@ DIST patchbundle-selinux-base-policy-2.20170204-r3.tar.bz2 342266 BLAKE2B 4b4fb4 DIST patchbundle-selinux-base-policy-2.20170204-r4.tar.bz2 373731 BLAKE2B cb291e14e181c68d95c77dc07185ba6d186d4a7f2bf163cbe32670d54cdf29e32ecfac49d449d8631df7df67992499e2bec6b39f6096f4d9e9394a87f2b24654 SHA512 93a0644440064d85db32c56a381478f8ef94824a04531e6fbad26dd79be02dacd939b804759db35d0627908ff653f8107e18c48858df458c80ae785d80374667 DIST patchbundle-selinux-base-policy-2.20170805-r2.tar.bz2 314854 BLAKE2B 483d04f364195eb8627153647118eb23812a610db63a40d50819b42c19fc20ffd0a36cd5c1959a764eab2109bd2e5317f74fd3a5cc1c7ddd17d8c85be05579a5 SHA512 1358db158945b82e0e41907e3919a6888564b4f15ad765f0fe2dc7bf284485c18d11c5502d598268e33b2163a6fa0be2a4029a8e9f774abfd4377031ee9afd32 DIST patchbundle-selinux-base-policy-2.20170805-r3.tar.bz2 324834 BLAKE2B ecc3b0425987aa648b3dd52977a6e1fd987e605fe302c3b6d8742d3eac9a1c89697de1f97331e9863b132bb95814ae7577e161a024cdda297fb84458aa9417fd SHA512 62ec2e70397d06d464e95305a4c0699cc07063d879d986a74442955fb8076a00cbe4a4f7a3cda46876cbf2ad38189be06f0c05ce9698aadafa6e9f02a8daf668 +DIST patchbundle-selinux-base-policy-2.20170805-r4.tar.bz2 689641 BLAKE2B 1accfbecd4825a6cdb8c3c189c9e23898d1dbe8415d2fe26a842782dec634958f01861916a3c040740359562984718b61cee7af7d9395b125590931110e67eff SHA512 2067b090cd054e47d6496c9513d69a7a37a72de8dc873159a8055e27fe2380dc73006354d790c455ae893645f956c6be6d6ad2d30be7428ff8a442604a0c5400 DIST refpolicy-2.20170204.tar.bz2 709965 BLAKE2B 7fb10d6054d74204f8c7d6d8ee88603f37b6600ed4a03e937a3a233ea7a80feef6ab90ba01af8d444fa79b266456260b14af3be0ad6a311baff6e3408af7d1ba SHA512 30deabb02a5bde51c463e3e89988d850cff51596c2e72733a064245dec152ea46317eea79550dbe82a7a0d327ec0bcfbd9474ff8a902507392df0da00df6397f DIST refpolicy-2.20170805.tar.bz2 740430 BLAKE2B 0597f51fceb5ca88b3506aa16cbd2d7f3df3a1d9c6afdf4cc5fc7eca25fa19c5810889f90ed1ee0abef401d41384558abb69f6638caf50341f71d075fa99e561 SHA512 dbb6809b028ae75296ad26d5997cc21d835c49555a0e37957cb39b36b144af6e817320073a29247448eba1876ab9e29d3956ff4456f1542b66ba38af459ec586 EBUILD selinux-base-2.20170204-r1.ebuild 4284 BLAKE2B ee5f7e898a6226019ce0257768151b41e3fa1c0ad38e01c5ebda9331ce92fcef503fcb893b04f17f8725fee715fee9840a049dd8b3c311e3817983b00174b640 SHA512 a33229c688249f633db2a8279a236d141b8c3958381c180bf2072982773dbb02750f108df855afd4e1ec04eca660ae2d42f492b57cd3ff01e60bfabaaefe331b @@ -14,5 +15,6 @@ EBUILD selinux-base-2.20170204-r3.ebuild 4282 BLAKE2B 123b7baf0cd584e3b305fef94e EBUILD selinux-base-2.20170204-r4.ebuild 4282 BLAKE2B 123b7baf0cd584e3b305fef94e2a15cd1aa03acf966739051bea816f8fc71bbe2c0d94b092aa2f6cd987e97c74a5d6e6cd5cdbfe302a912644da1d58496633b2 SHA512 afb5b7d59305173fef1a5e44d8bd67d97bb0c9f3c2546f9dfc33c63fdeb48dd97468c8c7f3ec7c8eab458c490298199e306bfa327034a21983dd03e6d78bfce1 EBUILD selinux-base-2.20170805-r2.ebuild 4229 BLAKE2B ab5d46cc5ce4a811959d57217ea52eefb2fd1ae84aea395c5192905b95a2c2cca719b7f33a4a47d6ca1f78d32c7715c21eecc5b74d76a4cdbc064a0ece34fc20 SHA512 d3bd2b7e545472924817350746d5fcc086982f20ba0108caa49486d9673debff82be89cefc7fc61584f621a50259c3bc7a0432bba1d7778c958f942193e87dc2 EBUILD selinux-base-2.20170805-r3.ebuild 4229 BLAKE2B ab5d46cc5ce4a811959d57217ea52eefb2fd1ae84aea395c5192905b95a2c2cca719b7f33a4a47d6ca1f78d32c7715c21eecc5b74d76a4cdbc064a0ece34fc20 SHA512 d3bd2b7e545472924817350746d5fcc086982f20ba0108caa49486d9673debff82be89cefc7fc61584f621a50259c3bc7a0432bba1d7778c958f942193e87dc2 +EBUILD selinux-base-2.20170805-r4.ebuild 4231 BLAKE2B b35811a2a3e1cc9e8c187cb8d16cda060abd82f5c9c2be4364769307b6edde34fb963eb1b23c870d0efee16fd8da0d168931e7f7ea5adaa0bb2dfa13c861fcb7 SHA512 95efa50852b58394c254efea11aec254bf211c01bc1187c9d34131869adf90540650aa9eb43994020c37677547a51a100ae083d04386e6fc23e46f33c4cccfe7 EBUILD selinux-base-9999.ebuild 4231 BLAKE2B b35811a2a3e1cc9e8c187cb8d16cda060abd82f5c9c2be4364769307b6edde34fb963eb1b23c870d0efee16fd8da0d168931e7f7ea5adaa0bb2dfa13c861fcb7 SHA512 95efa50852b58394c254efea11aec254bf211c01bc1187c9d34131869adf90540650aa9eb43994020c37677547a51a100ae083d04386e6fc23e46f33c4cccfe7 MISC metadata.xml 839 BLAKE2B 797f551065b80455c9538f115d680016954b7fc05cd5232ca09b86d83163c81e9ed868ea6b9be08d3c1284dcfd3527e88660befb747a631f4d2292331410cb52 SHA512 330017a98a3f9f4e6d6004955eb939c8d9c1c92fe6d091f78cdd7d2f6a02838c67a8a3268f38dad7df27f909ff51dc295d5de748f9767a257b5dad36c74d921a diff --git a/sec-policy/selinux-base/selinux-base-2.20170805-r4.ebuild b/sec-policy/selinux-base/selinux-base-2.20170805-r4.ebuild new file mode 100644 index 000000000000..75f0679ab23e --- /dev/null +++ b/sec-policy/selinux-base/selinux-base-2.20170805-r4.ebuild @@ -0,0 +1,161 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" + +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://raw.githubusercontent.com/wiki/TresysTechnology/refpolicy/files/refpolicy-${PV}.tar.bz2 + https://dev.gentoo.org/~swift/patches/selinux-base-policy/patchbundle-selinux-base-policy-${PVR}.tar.bz2" + + KEYWORDS="~amd64 -arm ~arm64 ~mips ~x86" +fi + +IUSE="doc +open_perms +peer_perms systemd +ubac +unconfined" + +DESCRIPTION="Gentoo base policy for SELinux" +HOMEPAGE="https://www.gentoo.org/proj/en/hardened/selinux/" +LICENSE="GPL-2" +SLOT="0" + +RDEPEND=">=sys-apps/policycoreutils-2.3 + virtual/udev" +DEPEND="${RDEPEND} + sys-devel/m4 + >=sys-apps/checkpolicy-2.3" + +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 peer_perms; then + sed -i -e '/network_peer_controls/d' \ + "${S}/refpolicy/policy/policy_capabilities" || die + fi + + if ! use open_perms; then + sed -i -e '/open_perms/d' \ + "${S}/refpolicy/policy/policy_capabilities" || die + 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 || die "Make conf failed" + + # 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 + + #cp "${FILESDIR}/modules-2.20120215.conf" "${S}/${i}/policy/modules.conf" + 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 \ + || die "${i} install failed." + + emake DESTDIR="${D}" install-headers \ + || die "${i} headers install failed." + + 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" +} -- cgit v1.2.3