summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris PeBenito <pebenito@gentoo.org>2003-08-11 00:05:12 +0000
committerChris PeBenito <pebenito@gentoo.org>2003-08-11 00:05:12 +0000
commitf3f955e642aacda60f0f6d49845050b9cc78c076 (patch)
tree3694aed84a828b8f957c88ddf56210270f085103 /sys-apps
parentsmall dep enhancement and mark 2.2.1 x86 (diff)
downloadgentoo-2-f3f955e642aacda60f0f6d49845050b9cc78c076.tar.gz
gentoo-2-f3f955e642aacda60f0f6d49845050b9cc78c076.tar.bz2
gentoo-2-f3f955e642aacda60f0f6d49845050b9cc78c076.zip
RDEP update, add rlpkg
Diffstat (limited to 'sys-apps')
-rw-r--r--sys-apps/policycoreutils/ChangeLog6
-rw-r--r--sys-apps/policycoreutils/Manifest5
-rw-r--r--sys-apps/policycoreutils/files/rlpkg77
-rw-r--r--sys-apps/policycoreutils/policycoreutils-1.0.ebuild5
4 files changed, 89 insertions, 4 deletions
diff --git a/sys-apps/policycoreutils/ChangeLog b/sys-apps/policycoreutils/ChangeLog
index 9141decf445b..187e36467f49 100644
--- a/sys-apps/policycoreutils/ChangeLog
+++ b/sys-apps/policycoreutils/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for sys-apps/policycoreutils
# Copyright 2000-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/policycoreutils/ChangeLog,v 1.1 2003/08/04 04:31:34 pebenito Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/policycoreutils/ChangeLog,v 1.2 2003/08/11 00:05:08 pebenito Exp $
+
+ 10 Aug 2003; Chris PeBenito <pebenito@gentoo.org>
+ policycoreutils-1.0.ebuild, files/rlpkg:
+ Add mkinitrd RDEP, add rlpkg.
*policycoreutils-1.0 (03 Aug 2003)
diff --git a/sys-apps/policycoreutils/Manifest b/sys-apps/policycoreutils/Manifest
index ab8f3a82a36a..f9e33e25957c 100644
--- a/sys-apps/policycoreutils/Manifest
+++ b/sys-apps/policycoreutils/Manifest
@@ -1,5 +1,6 @@
-MD5 107039bfb7b4e4512f10b946948650d8 policycoreutils-1.0.ebuild 879
+MD5 5e9c77e1722ffe0ba097de3e8d291708 policycoreutils-1.0.ebuild 925
MD5 fd55bafe00aa7a8e91b2d172642b0ef4 metadata.xml 268
-MD5 ae734e416fd50b4e3a5b065d7f3cac2e ChangeLog 421
+MD5 4039896986982685422a5c8d772f607f ChangeLog 549
MD5 a70bb20f56dfca63475bea2bc811927a files/digest-policycoreutils-1.0 67
MD5 6d4df7058894970c15d4066f7ad88c29 files/policycoreutils-1.0-gentoo.diff 1818
+MD5 1f231a1da642997577ac4567ee9867ac files/rlpkg 2317
diff --git a/sys-apps/policycoreutils/files/rlpkg b/sys-apps/policycoreutils/files/rlpkg
new file mode 100644
index 000000000000..229b49068c6c
--- /dev/null
+++ b/sys-apps/policycoreutils/files/rlpkg
@@ -0,0 +1,77 @@
+#!/bin/bash
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/policycoreutils/files/rlpkg,v 1.1 2003/08/11 00:05:08 pebenito Exp $
+
+# Author: Chris PeBenito <pebenito@gentoo.org>
+# this probably isnt the cleanest script, but it works.
+#
+# TODO:
+# -maybe add a -l function to list the package's files + contexts
+# -more informative messages, -h for help
+
+. /sbin/functions.sh
+PROG=`basename ${0}`
+
+if [ -z ${1} ]; then
+ echo "The Gentoo Linux package relabeler"
+ echo
+ echo "Usage: ${PROG} <pkg1> [<pkg2> ...]"
+ echo
+ echo "${PROG} relabels gentoo packages based on their CONTENTS file."
+ echo "Any files associated with a package, but not in the contents"
+ echo "will not be relabeled, so be careful! When in doubt, a full"
+ echo "relabel should be done."
+ exit 1;
+fi
+
+while [ ${#} -gt 0 ]; do
+ build="${build} `find /var/db/pkg -iname CONTENTS | cut -d/ -f5,6 | grep ${1} | sort`"
+ shift
+done
+
+if [ "${build}" == " " ]; then
+ echo "No matching packages found."
+ exit 1
+fi
+
+# ask portage what POLICYDIR is set to (inline python)
+# this should catch env vars too
+POLICYDIR="`python << EndOfFile
+import portage
+print portage.settings['POLICYDIR'];
+EndOfFile`"
+
+if [ -z ${POLICYDIR} ]; then
+ POLICYDIR="/etc/security/selinux/src/policy"
+ ewarn "Warning, no POLICYDIR set, using ${POLICYDIR}."
+ echo
+fi
+
+# make sure the policydir exists
+if [ ! -d ${POLICYDIR} ]; then
+ echo "The policy directory ${POLICYDIR} doesnt exist!"
+ echo
+ echo "Set the policy dir in make.conf: POLICYDIR=\"/etc/security/selinux/src/mypolicy\""
+ exit 1
+fi
+
+einfo "Using file contexts from the policy in ${POLICYDIR}."
+
+# generate file_contexts as needed
+ebegin "Regenerating file contexts"
+[ -f ${POLICYDIR}/file_contexts/file_contexts ] && rm -f ${POLICYDIR}/file_contexts/file_contexts
+make -C ${POLICYDIR} file_contexts/file_contexts &> /dev/null
+
+# do a test relabel to make sure file contexts work (doesnt change any labels)
+echo "/etc/passwd" | setfiles ${POLICYDIR}/file_contexts/file_contexts -sqn
+ret=$?
+eend $ret
+
+[ $ret == "0" ] || exit $ret
+
+for i in ${build}; do
+ ebegin "Relabeling: ${i}"
+ awk '{ print $2 }' < /var/db/pkg/${i}/CONTENTS | setfiles ${POLICYDIR}/file_contexts/file_contexts -sq &> /dev/null
+ eend $?
+done
diff --git a/sys-apps/policycoreutils/policycoreutils-1.0.ebuild b/sys-apps/policycoreutils/policycoreutils-1.0.ebuild
index 1b955da30475..3326c1235325 100644
--- a/sys-apps/policycoreutils/policycoreutils-1.0.ebuild
+++ b/sys-apps/policycoreutils/policycoreutils-1.0.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/policycoreutils/policycoreutils-1.0.ebuild,v 1.1 2003/08/04 04:31:34 pebenito Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/policycoreutils/policycoreutils-1.0.ebuild,v 1.2 2003/08/11 00:05:08 pebenito Exp $
IUSE=""
@@ -16,6 +16,7 @@ DEPEND="sys-libs/libselinux
sys-libs/pam"
RDEPEND="${DEPEND}
+ sys-apps/mkinitrd
sys-apps/checkpolicy
sec-policy/selinux-base-policy"
@@ -40,4 +41,6 @@ src_compile() {
src_install() {
make DESTDIR="${D}" install
+
+ dosbin ${FILESDIR}/rlpkg
}