diff options
author | Chris PeBenito <pebenito@gentoo.org> | 2004-04-20 01:57:44 +0000 |
---|---|---|
committer | Chris PeBenito <pebenito@gentoo.org> | 2004-04-20 01:57:44 +0000 |
commit | 664f8b92a11a85ceceee6b57239959389ab6b30a (patch) | |
tree | c23132c6629895999919523ee4cb85645f733aee /sys-apps/policycoreutils | |
parent | stable on amd64 (diff) | |
download | historical-664f8b92a11a85ceceee6b57239959389ab6b30a.tar.gz historical-664f8b92a11a85ceceee6b57239959389ab6b30a.tar.bz2 historical-664f8b92a11a85ceceee6b57239959389ab6b30a.zip |
new upstream version
Diffstat (limited to 'sys-apps/policycoreutils')
4 files changed, 173 insertions, 0 deletions
diff --git a/sys-apps/policycoreutils/Manifest b/sys-apps/policycoreutils/Manifest index 0cce89b9afa7..94648321e21e 100644 --- a/sys-apps/policycoreutils/Manifest +++ b/sys-apps/policycoreutils/Manifest @@ -1,7 +1,10 @@ MD5 af7800c21fe443d9890abc59c57cd050 policycoreutils-1.8.ebuild 1731 MD5 54987afd21da2dd0122e0b0ebd8f9d63 policycoreutils-1.4-r1.ebuild 1564 MD5 2b6207b7c001048d2a4b3da13082d778 ChangeLog 3642 +MD5 62a37a143010963b7400dfeb9f6c5526 policycoreutils-1.10.ebuild 1829 MD5 2eeb1df30e87ba2861eddbdc34a48bb8 metadata.xml 836 MD5 4be45e68d831caed22c82a9745d9e994 files/digest-policycoreutils-1.8 143 MD5 b9c41decc251443bb9535f415b9b1896 files/digest-policycoreutils-1.4-r1 143 +MD5 969c0b609dc456c2d605bc716a5ce7ef files/digest-policycoreutils-1.10 144 +MD5 440f1bd6fdf23f39dde7bd50aefc5731 files/policycoreutils-1.10-genhomedircon-reverse.diff 3459 MD5 b3e5bece06545088b90e09a70b01aa42 files/selinux-init 916 diff --git a/sys-apps/policycoreutils/files/digest-policycoreutils-1.10 b/sys-apps/policycoreutils/files/digest-policycoreutils-1.10 new file mode 100644 index 000000000000..7f9660414016 --- /dev/null +++ b/sys-apps/policycoreutils/files/digest-policycoreutils-1.10 @@ -0,0 +1,2 @@ +MD5 50c449595b8d415e2e00afd1bea2abe0 policycoreutils-1.10.tgz 38548 +MD5 e3f37c89c63fad4ca89a9b26399fd180 policycoreutils-extra-1.2.tar.bz2 8032 diff --git a/sys-apps/policycoreutils/files/policycoreutils-1.10-genhomedircon-reverse.diff b/sys-apps/policycoreutils/files/policycoreutils-1.10-genhomedircon-reverse.diff new file mode 100644 index 000000000000..9ffc8e53749b --- /dev/null +++ b/sys-apps/policycoreutils/files/policycoreutils-1.10-genhomedircon-reverse.diff @@ -0,0 +1,96 @@ +diff -urN policycoreutils-1.10/scripts/genhomedircon policycoreutils-1.8/scripts/genhomedircon +--- policycoreutils-1.10/scripts/genhomedircon 2004-03-24 11:48:00.000000000 -0600 ++++ policycoreutils-1.8/scripts/genhomedircon 2004-03-09 09:19:51.000000000 -0600 +@@ -6,8 +6,6 @@ + # genhomedircon - Replace HOME_ROOT, HOME_DIR, and ROLE macros in .fc files + # with generic and user-specific values. + # +-# Based off original script by Dan Walsh, <dwalsh@redhat.com> +-# + # ASSUMPTIONS: + # + # If a user has more than one role in FILECONTEXTDIR/users, genhomedircon uses +@@ -24,6 +22,7 @@ + + import commands, sys, os, pwd, string + ++FILECONTEXTDIR="/etc/security/selinux/src/policy/" + EXCLUDE_LOGINS=["/sbin/nologin", "/bin/false"] + STARTING_UID=100 + +@@ -39,7 +38,7 @@ + if not prefixes.has_key(prefix): + prefixes[prefix] = "" + return prefixes +- ++ + def getUsers(): + rc = commands.getstatusoutput("grep ^user %s/users" % FILECONTEXTDIR) + udict = {} +@@ -66,12 +65,12 @@ + def usage(error = ""): + if error != "": + sys.stderr.write("%s\n" % (error,)) +- sys.stderr.write("Usage: %s POLICYSOURCEDIR FILE_CONTEXTS\n" % sys.argv[0]) ++ sys.stderr.write("Usage: %s FILE_CONTEXTS\n" % sys.argv[0]) + sys.stderr.flush() + sys.exit(1) +- ++ + def update(filecontext, user, prefs): +- rc=commands.getstatusoutput("grep -h '^HOME_DIR' %s | grep -v vmware | sed -e 's|HOME_DIR|%s|' -e 's/ROLE/%s/' -e 's/system_u/%s/'" % (filecontext, prefs["home"], prefs["role"], user)) ++ rc=commands.getstatusoutput("grep -h '^HOME_DIR' %s | grep -v vmware | sed -e 's|HOME_DIR|%s|g' -e 's/ROLE/%s/' -e 's/system_u/%s/'" % (filecontext, prefs["home"], prefs["role"], user)) + if rc[0] == 0: + print rc[1] + else: +@@ -79,11 +78,6 @@ + return rc + + try: +- if len(sys.argv) != 3: +- print len(sys.argv) +- usage() +- +- FILECONTEXTDIR=sys.argv[1] + prefixes = getPrefixes() + + rc=commands.getstatusoutput("grep -h '^HOME' /etc/default/useradd") +@@ -91,20 +85,21 @@ + homedir = rc[1].split("=")[1] + else: + sys.stderr.write("%s\n" % (rc[1],)) +- sys.stderr.write("You do not have access to /etc/default/useradd, default /home\n") ++ sys.stderr.write("Do you have access to /etc/default/useradd?\n") + sys.stderr.flush() +- homedir = "/home" +- ++ sys.exit(1) + + if not prefixes.has_key(homedir): + prefixes[homedir] = "" + +- # There may be a more elegant sed script to expand a macro to multiple lines, but this works +- sed_root = "h; s|^HOME_ROOT|%s|" % (string.join(prefixes.keys(), "|; p; g; s|^HOME_ROOT|"),) +- sed_dir = "h; s|^HOME_DIR|%s/[^/]+|; s|ROLE_|user_|" % (string.join(prefixes.keys(), "/[^/]+|; s|ROLE_|user_|; p; g; s|^HOME_DIR|"),) ++ if len(prefixes) == 1: ++ regex_root = prefixes.keys()[0] ++ else: ++ regex_root = "(%s)" % (string.join(prefixes, "\|"),) ++ regex_dir = "%s/[^/]+" % (regex_root,) + + # Fill in HOME_ROOT, HOME_DIR, and ROLE for users not explicitly defined in /etc/security/selinux/src/policy/users +- rc=commands.getstatusoutput("sed -e \"/^HOME_ROOT/{%s}\" -e \"/^HOME_DIR/{%s}\" %s" % (sed_root, sed_dir, sys.argv[2])) ++ rc=commands.getstatusoutput("sed -e 's|^HOME_ROOT|%s|g' -e 's|^HOME_DIR|%s|g' -e 's/ROLE_/user_/' %s" % (regex_root, regex_dir, sys.argv[1])) + if rc[0] == 0: + print rc[1] + else: +@@ -115,7 +110,8 @@ + + # Fill in HOME and ROLE for users that are defined + for u in users.keys(): +- update(sys.argv[2], u, users[u]) ++ update(sys.argv[1], u, users[u]) ++ + except ValueError, error: + usage(error) + except IndexError, error: diff --git a/sys-apps/policycoreutils/policycoreutils-1.10.ebuild b/sys-apps/policycoreutils/policycoreutils-1.10.ebuild new file mode 100644 index 000000000000..15d76336abb9 --- /dev/null +++ b/sys-apps/policycoreutils/policycoreutils-1.10.ebuild @@ -0,0 +1,72 @@ +# Copyright 1999-2004 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/policycoreutils/policycoreutils-1.10.ebuild,v 1.1 2004/04/20 01:57:43 pebenito Exp $ + +IUSE="build" + +inherit eutils + +EXTRAS_VER="1.2" + +DESCRIPTION="SELinux core utilites" +HOMEPAGE="http://www.nsa.gov/selinux" +SRC_URI="http://www.nsa.gov/selinux/archives/${P}.tgz + mirror://gentoo/policycoreutils-extra-${EXTRAS_VER}.tar.bz2" +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~x86 ~ppc ~sparc" + +DEPEND=">=sys-libs/libselinux-${PV} + sys-devel/gettext + !build? ( sys-libs/pam )" + +RDEPEND="${DEPEND}" + +S2=${WORKDIR}/policycoreutils-extra + +src_unpack() { + unpack ${A} + + cd ${S} + epatch ${FILESDIR}/policycoreutils-1.10-genhomedircon-reverse.diff + + # Change script paths POLICYDIR + sed -i -e "s:/etc/security/selinux/src/policy/:${POLICYDIR}:g" ${S}/scripts/genhomedircon + + # fix up to accept Gentoo CFLAGS + local SUBDIRS="`cd ${S} && find -type d | cut -d/ -f2`" + for i in ${SUBDIRS}; do + sed -i -e "s:-Wall:-Wall ${CFLAGS}:g" ${S}/${i}/Makefile \ + || die "${i} Makefile CFLAGS fix failed." + done +} + +src_compile() { + if use build; then + einfo "Compiling setfiles" + emake -C ${S}/setfiles || die + else + einfo "Compiling policycoreutils" + emake -C ${S} || die + einfo "Compiling policycoreutils-extra" + emake -C ${S2} || die + fi +} + +src_install() { + if use build; then + dosbin ${S}/setfiles/setfiles + else + einfo "Installing policycoreutils" + make DESTDIR="${D}" -C ${S} install || die + einfo "Installing policycoreutils-extra" + make DESTDIR="${D}" -C ${S2} install || die + fi +} + +pkg_postinst() { + ewarn "WARNING: seinit is deprecated, and is no" + ewarn "longer installed. Please remove seinit from" + ewarn "your bootloader. The policy is now loaded" + ewarn "by init itself." +} |