summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Zaman <perfinion@gentoo.org>2017-02-18 15:22:14 +0800
committerJason Zaman <perfinion@gentoo.org>2017-02-18 15:28:28 +0800
commit9fac31ef4df43a77d2a36f16a96fcb7f2653514c (patch)
treef723165a9568a3a102d6d87bb7332e726810e40f /sec-policy/selinux-base
parentdev-ruby/autoprefixer-rails: initial import of 6.7.3 (diff)
downloadgentoo-9fac31ef4df43a77d2a36f16a96fcb7f2653514c.tar.gz
gentoo-9fac31ef4df43a77d2a36f16a96fcb7f2653514c.tar.bz2
gentoo-9fac31ef4df43a77d2a36f16a96fcb7f2653514c.zip
sec-policy: Release of SELinux policies 2.20170204-r1
Package-Manager: portage-2.3.3
Diffstat (limited to 'sec-policy/selinux-base')
-rw-r--r--sec-policy/selinux-base/Manifest2
-rw-r--r--sec-policy/selinux-base/selinux-base-2.20170204-r1.ebuild161
2 files changed, 163 insertions, 0 deletions
diff --git a/sec-policy/selinux-base/Manifest b/sec-policy/selinux-base/Manifest
index d59fcbc8d961..a11d8c12cd06 100644
--- a/sec-policy/selinux-base/Manifest
+++ b/sec-policy/selinux-base/Manifest
@@ -3,5 +3,7 @@ DIST patchbundle-selinux-base-policy-2.20151208-r6.tar.bz2 307239 SHA256 dd8cbe5
DIST patchbundle-selinux-base-policy-2.20161023-r1.tar.bz2 298107 SHA256 fa5be024a7f3b59b155f3cb3852d8b4124f4e75112cd42014090146221169660 SHA512 f8720e4998023aa5186dd5fdebeb41eb998992fd629dd3ae369c855c00308a0aa47761b7a0fb4638893d7b3d8ef42e11b1ca7c5010cfc055258a3077d83f396d WHIRLPOOL 2cfcb976a2beb5e55049e562d75bb3887ca0cbeac9bc630df23a4456f4026f31673b0be012c8ffda89af9b7417b7202089607cd79e6804f69fa826dd017779f4
DIST patchbundle-selinux-base-policy-2.20161023-r3.tar.bz2 321394 SHA256 76521408b62a17120072cd0db5e037f4b7b967be4340985ce354786e5d2948f7 SHA512 2e9ca3be900c549ddbcd306f1bf5483934d7baf23ffd66a2172d26bcb81b4aa768596555dd8d362398013778e7a127024ec2468d6bf1b487f0c4a14e479e53f4 WHIRLPOOL 246399de9a96f3605fd490cd118f4301b19935990705ab87133911ad3e4befb5aa6d412e5e43b2e2c60936bc485969f55406316c3d37c2a2e8676642153231dd
DIST patchbundle-selinux-base-policy-2.20161023-r4.tar.bz2 358553 SHA256 d105d5fbf2859d7f9766ef46ef29c3d71165b4f5ff9548bcbdeca5a1f76b0c27 SHA512 a99f3eda699eb4b040c19f51060a96a116a76aabda323d1a2d840f130c6ccfe34118645d296d48f855a2a2abb0ab6db686b37d02950012798796eafcebfdd781 WHIRLPOOL 849b0e88ed3f1f54de18c0c2edcc0fecd3968e30eb970aace41d0b79aa3d203b2bbcf96f4c564fed95e7b3c8e3b2f524e11c9942ab36e6d6c49431696925b8a8
+DIST patchbundle-selinux-base-policy-2.20170204-r1.tar.bz2 327838 SHA256 66ca7d95e7af81f30dce42550f6dccba0cabc52fefa18747a552ef8caa892e4c SHA512 727dd11bc5a777388199fb1da67add940a6051cca874456cdc4bb65f567216481e70b92fcf37ac59cc48d907fbe87b67e97c3813c4c97d5f31b7c66b7246f166 WHIRLPOOL 6235b026ee9c9acff18923634b6047e155d836a3544ae8e5e4448cc198732629fc163e5374b0546187703afe020a3473d3e2bc3883533a96fe3537fa14487fa4
DIST refpolicy-2.20151208.tar.bz2 698182 SHA256 2dd2f45a7132137afe8302805c3b7839739759b9ab73dd1815c01afe34ac99de SHA512 cbefe117f143adea834065949e24e9fe86336c049e9e0518026597d5b0a18c482a9717422bd39b7fb0012d19df00365c969d87e1f13a7bb9dcb9996313ed6cf8 WHIRLPOOL cb843a602dde4234a62e6f92001bff689a457796215b015bcccce79e7aa73bfe875a82bdbdbf59236f218eb41aaf665fcc5753c42d86eb3ed1caa1b69ddc2efa
DIST refpolicy-2.20161023.tar.bz2 1768667 SHA256 14c9576e2cdf0ecf656134bc59cba99589dbba2895344d2fc226bdb5d8e541c7 SHA512 3201ca3c6cada1053343d3763d36072cf40afa46bf5343087a8254320879cb61fef539dc7742e04e5645d0c886b8f4bf552bf502e9716f7a3282efc0b0ed970d WHIRLPOOL 3f44955c3b13f5a6152d8ca8b75b3c8d52becc1c47b3b0126f5c86fbdad8bf6a1ae72c42e0b130352e139f987340b3c0d3d37aac5b80c5e3d731fcd666b88504
+DIST refpolicy-2.20170204.tar.bz2 709965 SHA256 5e4daee61d89dfdc8c7bf369f81c99845931e337916dc6401e301c5de57ea336 SHA512 30deabb02a5bde51c463e3e89988d850cff51596c2e72733a064245dec152ea46317eea79550dbe82a7a0d327ec0bcfbd9474ff8a902507392df0da00df6397f WHIRLPOOL a6b6aa1265f3e7e78c6e8012f0cb8098e0727e77bfcf8165866e876b41c18648711c82d87750c081cc49e89b85be03ef3b420a2df25269e2ce070181af308ec6
diff --git a/sec-policy/selinux-base/selinux-base-2.20170204-r1.ebuild b/sec-policy/selinux-base/selinux-base-2.20170204-r1.ebuild
new file mode 100644
index 000000000000..86f95abc01fa
--- /dev/null
+++ b/sec-policy/selinux-base/selinux-base-2.20170204-r1.ebuild
@@ -0,0 +1,161 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+EAPI="6"
+
+if [[ ${PV} == 9999* ]]; then
+ EGIT_REPO_URI="${SELINUX_GIT_REPO:-git://anongit.gentoo.org/proj/hardened-refpolicy.git 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"
+}