summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2016-02-17 14:45:14 -0500
committerMike Frysinger <vapier@gentoo.org>2016-02-17 15:11:03 -0500
commitfc3a6a5fcb47813cc8e8d3a7998b1a31a4b7a491 (patch)
treef5784e4ee0cfa3249ac0ce3b05952a68531f916c /sys-libs/libsemanage
parentsys-libs/libsemanage: fix bad -I/-L flag usage (diff)
downloadgentoo-fc3a6a5fcb47813cc8e8d3a7998b1a31a4b7a491.tar.gz
gentoo-fc3a6a5fcb47813cc8e8d3a7998b1a31a4b7a491.tar.bz2
gentoo-fc3a6a5fcb47813cc8e8d3a7998b1a31a4b7a491.zip
sys-libs/libsemanage: improve ROOT handling in pkg_postinst
Also ignore errors when /etc/selinux/config doesn't exist.
Diffstat (limited to 'sys-libs/libsemanage')
-rw-r--r--sys-libs/libsemanage/libsemanage-2.4-r2.ebuild6
-rw-r--r--sys-libs/libsemanage/libsemanage-9999.ebuild6
2 files changed, 6 insertions, 6 deletions
diff --git a/sys-libs/libsemanage/libsemanage-2.4-r2.ebuild b/sys-libs/libsemanage/libsemanage-2.4-r2.ebuild
index d43e13b090e6..e2b0457863ba 100644
--- a/sys-libs/libsemanage/libsemanage-2.4-r2.ebuild
+++ b/sys-libs/libsemanage/libsemanage-2.4-r2.ebuild
@@ -112,8 +112,8 @@ multilib_src_install() {
pkg_postinst() {
# Migrate the SELinux semanage configuration store if not done already
- local selinuxtype=$(awk -F'=' '/SELINUXTYPE=/ {print $2}' /etc/selinux/config);
- if [ -n "${selinuxtype}" ] && [ ! -d /var/lib/selinux/${mcs}/active ] ; then
+ local selinuxtype=$(awk -F'=' '/SELINUXTYPE=/ {print $2}' "${EROOT}"/etc/selinux/config 2>/dev/null)
+ if [ -n "${selinuxtype}" ] && [ ! -d "${EROOT}"/var/lib/selinux/${mcs}/active ] ; then
ewarn "Since the 2.4 SELinux userspace, the policy module store is moved"
ewarn "from /etc/selinux to /var/lib/selinux. The migration will be run now."
ewarn "If there are any issues, it can be done manually by running:"
@@ -124,7 +124,7 @@ pkg_postinst() {
# Run the store migration without rebuilds
for POLICY_TYPE in ${POLICY_TYPES} ; do
- if [ ! -d "${ROOT}/var/lib/selinux/${POLICY_TYPE}/active" ] ; then
+ if [ ! -d "${EROOT}/var/lib/selinux/${POLICY_TYPE}/active" ] ; then
einfo "Migrating store ${POLICY_TYPE} (without policy rebuild)."
/usr/libexec/selinux/semanage_migrate_store -n -s "${POLICY_TYPE}" || die "Failed to migrate store ${POLICY_TYPE}"
fi
diff --git a/sys-libs/libsemanage/libsemanage-9999.ebuild b/sys-libs/libsemanage/libsemanage-9999.ebuild
index 734b83821ca6..bb698140b2c8 100644
--- a/sys-libs/libsemanage/libsemanage-9999.ebuild
+++ b/sys-libs/libsemanage/libsemanage-9999.ebuild
@@ -118,8 +118,8 @@ multilib_src_install() {
pkg_postinst() {
# Migrate the SELinux semanage configuration store if not done already
- local selinuxtype=$(awk -F'=' '/SELINUXTYPE=/ {print $2}' /etc/selinux/config);
- if [ -n "${selinuxtype}" ] && [ ! -d /var/lib/selinux/${mcs}/active ] ; then
+ local selinuxtype=$(awk -F'=' '/SELINUXTYPE=/ {print $2}' "${EROOT}"/etc/selinux/config 2>/dev/null)
+ if [ -n "${selinuxtype}" ] && [ ! -d "${EROOT}"/var/lib/selinux/${mcs}/active ] ; then
ewarn "Since the 2.4 SELinux userspace, the policy module store is moved"
ewarn "from /etc/selinux to /var/lib/selinux. The migration will be run now."
ewarn "If there are any issues, it can be done manually by running:"
@@ -130,7 +130,7 @@ pkg_postinst() {
# Run the store migration without rebuilds
for POLICY_TYPE in ${POLICY_TYPES} ; do
- if [ ! -d "${ROOT}/var/lib/selinux/${POLICY_TYPE}/active" ] ; then
+ if [ ! -d "${EROOT}/var/lib/selinux/${POLICY_TYPE}/active" ] ; then
einfo "Migrating store ${POLICY_TYPE} (without policy rebuild)."
/usr/libexec/selinux/semanage_migrate_store -n -s "${POLICY_TYPE}" || die "Failed to migrate store ${POLICY_TYPE}"
fi