Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove obsolete selinux modules #23568

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -28,6 +28,7 @@ BDEPEND="
sys-devel/m4"

MODS="application authlogin bootloader clock consoletype cron dmesg fstools getty hostname init iptables libraries locallogin logging lvm miscfiles modutils mount mta netutils nscd portage raid rsync selinuxutil setrans ssh staff storage su sysadm sysnetwork systemd tmpfiles udev userdomain usermanage unprivuser xdg"
DEL_MODS="hotplug"
LICENSE="GPL-2"
SLOT="0"
S="${WORKDIR}/"
Expand Down Expand Up @@ -105,12 +106,24 @@ pkg_postinst() {
COMMAND="${COMMAND} -i ${i}.pp"
done

for i in ${DEL_MODS}; do
[[ "${MODS}" != "*${i}*" ]] || die "Duplicate module in MODS and DEL_MODS: ${i}"
done

for i in ${POLICY_TYPES}; do
einfo "Inserting the following modules, with base, into the $i module store: ${MODS}"

cd "${ROOT}/usr/share/selinux/${i}"

semodule ${root_opts} -s ${i} ${COMMAND}

if [ -n "${DEL_MODS}" ];then
for mod in ${DEL_MODS}; do
if semodule ${root_opts} -s ${i} -l | grep -q "\b${mod}\b"; then
semodule ${root_opts} -s ${i} -r ${mod}
fi
done
fi
done

# Don't relabel when cross compiling
Expand Down
Expand Up @@ -28,6 +28,7 @@ BDEPEND="
sys-devel/m4"

MODS="application authlogin bootloader clock consoletype cron dmesg fstools getty hostname init iptables libraries locallogin logging lvm miscfiles modutils mount mta netutils nscd portage raid rsync selinuxutil setrans ssh staff storage su sysadm sysnetwork systemd tmpfiles udev userdomain usermanage unprivuser xdg"
DEL_MODS="hotplug"
LICENSE="GPL-2"
SLOT="0"
S="${WORKDIR}/"
Expand Down Expand Up @@ -105,12 +106,24 @@ pkg_postinst() {
COMMAND="${COMMAND} -i ${i}.pp"
done

for i in ${DEL_MODS}; do
[[ "${MODS}" != "*${i}*" ]] || die "Duplicate module in MODS and DEL_MODS: ${i}"
done

for i in ${POLICY_TYPES}; do
einfo "Inserting the following modules, with base, into the $i module store: ${MODS}"

cd "${ROOT}/usr/share/selinux/${i}"

semodule ${root_opts} -s ${i} ${COMMAND}

if [ -n "${DEL_MODS}" ];then
for mod in ${DEL_MODS}; do
if semodule ${root_opts} -s ${i} -l | grep -q "\b${mod}\b"; then
semodule ${root_opts} -s ${i} -r ${mod}
fi
done
fi
done

# Don't relabel when cross compiling
Expand Down