Gentoo Archives: gentoo-commits

From: Mike Frysinger <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/libsemanage/
Date: Wed, 17 Feb 2016 20:11:24
Message-Id: 1455739863.fc3a6a5fcb47813cc8e8d3a7998b1a31a4b7a491.vapier@gentoo
1 commit: fc3a6a5fcb47813cc8e8d3a7998b1a31a4b7a491
2 Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
3 AuthorDate: Wed Feb 17 19:45:14 2016 +0000
4 Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
5 CommitDate: Wed Feb 17 20:11:03 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fc3a6a5f
7
8 sys-libs/libsemanage: improve ROOT handling in pkg_postinst
9
10 Also ignore errors when /etc/selinux/config doesn't exist.
11
12 sys-libs/libsemanage/libsemanage-2.4-r2.ebuild | 6 +++---
13 sys-libs/libsemanage/libsemanage-9999.ebuild | 6 +++---
14 2 files changed, 6 insertions(+), 6 deletions(-)
15
16 diff --git a/sys-libs/libsemanage/libsemanage-2.4-r2.ebuild b/sys-libs/libsemanage/libsemanage-2.4-r2.ebuild
17 index d43e13b..e2b0457 100644
18 --- a/sys-libs/libsemanage/libsemanage-2.4-r2.ebuild
19 +++ b/sys-libs/libsemanage/libsemanage-2.4-r2.ebuild
20 @@ -112,8 +112,8 @@ multilib_src_install() {
21
22 pkg_postinst() {
23 # Migrate the SELinux semanage configuration store if not done already
24 - local selinuxtype=$(awk -F'=' '/SELINUXTYPE=/ {print $2}' /etc/selinux/config);
25 - if [ -n "${selinuxtype}" ] && [ ! -d /var/lib/selinux/${mcs}/active ] ; then
26 + local selinuxtype=$(awk -F'=' '/SELINUXTYPE=/ {print $2}' "${EROOT}"/etc/selinux/config 2>/dev/null)
27 + if [ -n "${selinuxtype}" ] && [ ! -d "${EROOT}"/var/lib/selinux/${mcs}/active ] ; then
28 ewarn "Since the 2.4 SELinux userspace, the policy module store is moved"
29 ewarn "from /etc/selinux to /var/lib/selinux. The migration will be run now."
30 ewarn "If there are any issues, it can be done manually by running:"
31 @@ -124,7 +124,7 @@ pkg_postinst() {
32
33 # Run the store migration without rebuilds
34 for POLICY_TYPE in ${POLICY_TYPES} ; do
35 - if [ ! -d "${ROOT}/var/lib/selinux/${POLICY_TYPE}/active" ] ; then
36 + if [ ! -d "${EROOT}/var/lib/selinux/${POLICY_TYPE}/active" ] ; then
37 einfo "Migrating store ${POLICY_TYPE} (without policy rebuild)."
38 /usr/libexec/selinux/semanage_migrate_store -n -s "${POLICY_TYPE}" || die "Failed to migrate store ${POLICY_TYPE}"
39 fi
40
41 diff --git a/sys-libs/libsemanage/libsemanage-9999.ebuild b/sys-libs/libsemanage/libsemanage-9999.ebuild
42 index 734b838..bb69814 100644
43 --- a/sys-libs/libsemanage/libsemanage-9999.ebuild
44 +++ b/sys-libs/libsemanage/libsemanage-9999.ebuild
45 @@ -118,8 +118,8 @@ multilib_src_install() {
46
47 pkg_postinst() {
48 # Migrate the SELinux semanage configuration store if not done already
49 - local selinuxtype=$(awk -F'=' '/SELINUXTYPE=/ {print $2}' /etc/selinux/config);
50 - if [ -n "${selinuxtype}" ] && [ ! -d /var/lib/selinux/${mcs}/active ] ; then
51 + local selinuxtype=$(awk -F'=' '/SELINUXTYPE=/ {print $2}' "${EROOT}"/etc/selinux/config 2>/dev/null)
52 + if [ -n "${selinuxtype}" ] && [ ! -d "${EROOT}"/var/lib/selinux/${mcs}/active ] ; then
53 ewarn "Since the 2.4 SELinux userspace, the policy module store is moved"
54 ewarn "from /etc/selinux to /var/lib/selinux. The migration will be run now."
55 ewarn "If there are any issues, it can be done manually by running:"
56 @@ -130,7 +130,7 @@ pkg_postinst() {
57
58 # Run the store migration without rebuilds
59 for POLICY_TYPE in ${POLICY_TYPES} ; do
60 - if [ ! -d "${ROOT}/var/lib/selinux/${POLICY_TYPE}/active" ] ; then
61 + if [ ! -d "${EROOT}/var/lib/selinux/${POLICY_TYPE}/active" ] ; then
62 einfo "Migrating store ${POLICY_TYPE} (without policy rebuild)."
63 /usr/libexec/selinux/semanage_migrate_store -n -s "${POLICY_TYPE}" || die "Failed to migrate store ${POLICY_TYPE}"
64 fi