diff options
author | Sven Vermeulen <swift@gentoo.org> | 2012-05-13 08:47:37 +0000 |
---|---|---|
committer | Sven Vermeulen <swift@gentoo.org> | 2012-05-13 08:47:37 +0000 |
commit | e255fd45c11dd50063bdebc11844c509628a09a0 (patch) | |
tree | 11ebd51ece65041d9f9dbb120ab774c2ee8cbf58 /sys-libs | |
parent | Don't try to install nonexistent docs. #415703 (diff) | |
download | gentoo-2-e255fd45c11dd50063bdebc11844c509628a09a0.tar.gz gentoo-2-e255fd45c11dd50063bdebc11844c509628a09a0.tar.bz2 gentoo-2-e255fd45c11dd50063bdebc11844c509628a09a0.zip |
Mount /sys before /sys/fs/selinux, bug #414779
(Portage version: 2.1.10.49/cvs/Linux x86_64)
Diffstat (limited to 'sys-libs')
-rw-r--r-- | sys-libs/libselinux/ChangeLog | 9 | ||||
-rw-r--r-- | sys-libs/libselinux/files/libselinux-2.1.9-mountsys.patch | 22 | ||||
-rw-r--r-- | sys-libs/libselinux/libselinux-2.1.9-r1.ebuild | 85 |
3 files changed, 115 insertions, 1 deletions
diff --git a/sys-libs/libselinux/ChangeLog b/sys-libs/libselinux/ChangeLog index 9e153f76c15b..8418438aa044 100644 --- a/sys-libs/libselinux/ChangeLog +++ b/sys-libs/libselinux/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for sys-libs/libselinux # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-libs/libselinux/ChangeLog,v 1.78 2012/04/29 10:06:56 swift Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-libs/libselinux/ChangeLog,v 1.79 2012/05/13 08:47:37 swift Exp $ + +*libselinux-2.1.9-r1 (13 May 2012) + + 13 May 2012; <swift@gentoo.org> +libselinux-2.1.9-r1.ebuild, + +files/libselinux-2.1.9-mountsys.patch: + Mount /sys before trying to mount /sys/fs/selinux from within the policy load + functions, bug #414779 29 Apr 2012; <swift@gentoo.org> libselinux-2.1.9.ebuild: Stabilization diff --git a/sys-libs/libselinux/files/libselinux-2.1.9-mountsys.patch b/sys-libs/libselinux/files/libselinux-2.1.9-mountsys.patch new file mode 100644 index 000000000000..f2a206d1f1ae --- /dev/null +++ b/sys-libs/libselinux/files/libselinux-2.1.9-mountsys.patch @@ -0,0 +1,22 @@ +diff -ur libselinux-2.1.9.orig/src/load_policy.c libselinux-2.1.9/src/load_policy.c +--- libselinux-2.1.9.orig/src/load_policy.c 2012-05-05 10:33:06.130719282 +0200 ++++ libselinux-2.1.9/src/load_policy.c 2012-05-05 10:43:45.024720646 +0200 +@@ -370,8 +370,16 @@ + * mount it if present for use in the calls below. + */ + char *mntpoint = NULL; +- if (mount(SELINUXFS, SELINUXMNT, SELINUXFS, 0, 0) == 0 || errno == EBUSY) { +- mntpoint = SELINUXMNT; ++ /* First make sure /sys is mounted */ ++ if (mount("sysfs", "/sys", "sysfs", 0, 0) == 0 || errno == EBUSY) { ++ if (mount(SELINUXFS, SELINUXMNT, SELINUXFS, 0, 0) == 0 || errno == EBUSY) { ++ mntpoint = SELINUXMNT; ++ } else { ++ /* check old mountpoint */ ++ if (mount(SELINUXFS, OLDSELINUXMNT, SELINUXFS, 0, 0) == 0 || errno == EBUSY) { ++ mntpoint = OLDSELINUXMNT; ++ } ++ } + } else { + /* check old mountpoint */ + if (mount(SELINUXFS, OLDSELINUXMNT, SELINUXFS, 0, 0) == 0 || errno == EBUSY) { diff --git a/sys-libs/libselinux/libselinux-2.1.9-r1.ebuild b/sys-libs/libselinux/libselinux-2.1.9-r1.ebuild new file mode 100644 index 000000000000..629dd03427f3 --- /dev/null +++ b/sys-libs/libselinux/libselinux-2.1.9-r1.ebuild @@ -0,0 +1,85 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-libs/libselinux/libselinux-2.1.9-r1.ebuild,v 1.1 2012/05/13 08:47:37 swift Exp $ + +EAPI="4" +PYTHON_DEPEND="python? *" +SUPPORT_PYTHON_ABIS="1" +RESTRICT_PYTHON_ABIS="*-jython" + +inherit multilib python toolchain-funcs eutils + +SEPOL_VER="2.1.4" + +DESCRIPTION="SELinux userland library" +HOMEPAGE="http://userspace.selinuxproject.org" +SRC_URI="http://userspace.selinuxproject.org/releases/20120216/${P}.tar.gz" + +LICENSE="public-domain" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="python ruby" + +RDEPEND=">=sys-libs/libsepol-${SEPOL_VER} + ruby? ( dev-lang/ruby )" +DEPEND="${RDEPEND} + ruby? ( dev-lang/swig ) + python? ( dev-lang/swig )" + +pkg_setup() { + if use python; then + python_pkg_setup + fi +} + +src_prepare() { + # fix up paths for multilib + sed -i -e "/^LIBDIR/s/lib/$(get_libdir)/" "${S}/src/Makefile" \ + || die "Fix for multilib LIBDIR failed." + sed -i -e "/^SHLIBDIR/s/lib/$(get_libdir)/" "${S}/src/Makefile" \ + || die "Fix for multilib SHLIBDIR failed." + epatch "${FILESDIR}/${P}-mountsys.patch" +} + +src_compile() { + emake AR="$(tc-getAR)" CC="$(tc-getCC)" LDFLAGS="-fPIC ${LDFLAGS}" all || die + + if use python; then + python_copy_sources src + building() { + emake CC="$(tc-getCC)" PYLIBVER="python$(python_get_version)" PYPREFIX="python-$(python_get_version)" LDFLAGS="-fPIC ${LDFLAGS}" pywrap + } + python_execute_function -s --source-dir src building + fi + + if use ruby; then + emake CC="$(tc-getCC)" rubywrap || die + fi +} + +src_install() { + emake DESTDIR="${D}" install || die + + if use python; then + installation() { + emake DESTDIR="${D}" PYLIBVER="python$(python_get_version)" PYPREFIX="python-$(python_get_version)" install-pywrap + } + python_execute_function -s --source-dir src installation + fi + + if use ruby; then + emake DESTDIR="${D}" install-rubywrap || die + fi +} + +pkg_postinst() { + if use python; then + python_mod_optimize selinux + fi +} + +pkg_postrm() { + if use python; then + python_mod_cleanup selinux + fi +} |