diff options
author | Michael Palimaka <kensington@gentoo.org> | 2020-10-10 20:33:24 +1100 |
---|---|---|
committer | Michael Palimaka <kensington@gentoo.org> | 2020-10-10 20:44:03 +1100 |
commit | 514bb9c90fb2641b7af156c4d504185dc10db795 (patch) | |
tree | 5d3e1fccfc0978998e03868e7f24fc8c3f607155 /sys-apps/apparmor/files | |
parent | sys-libs/libapparmor: version bump 3.0.0 (diff) | |
download | gentoo-514bb9c90fb2641b7af156c4d504185dc10db795.tar.gz gentoo-514bb9c90fb2641b7af156c4d504185dc10db795.tar.bz2 gentoo-514bb9c90fb2641b7af156c4d504185dc10db795.zip |
sys-apps/apparmor: version bump 3.0.0
Package-Manager: Portage-3.0.4, Repoman-3.0.1
Signed-off-by: Michael Palimaka <kensington@gentoo.org>
Diffstat (limited to 'sys-apps/apparmor/files')
-rw-r--r-- | sys-apps/apparmor/files/apparmor-3.0.0-makefile.patch | 18 | ||||
-rw-r--r-- | sys-apps/apparmor/files/apparmor-init-1 | 88 |
2 files changed, 106 insertions, 0 deletions
diff --git a/sys-apps/apparmor/files/apparmor-3.0.0-makefile.patch b/sys-apps/apparmor/files/apparmor-3.0.0-makefile.patch new file mode 100644 index 000000000000..9c03a4465c36 --- /dev/null +++ b/sys-apps/apparmor/files/apparmor-3.0.0-makefile.patch @@ -0,0 +1,18 @@ +* Avoid installing empty /var/lib/apparmor +* Install rc.apparmor.functions to Gentoo-appropriate location + +--- a/Makefile ++++ b/Makefile +@@ -407,10 +407,10 @@ + .PHONY: install-indep + install-indep: indep + install -m 755 -d $(INSTALL_CONFDIR) ++ install -m 755 -d ${DESTDIR}/usr/libexec + install -m 644 parser.conf $(INSTALL_CONFDIR) +- install -m 755 -d ${DESTDIR}/var/lib/apparmor + install -m 755 -d $(APPARMOR_BIN_PREFIX) +- install -m 755 rc.apparmor.functions $(APPARMOR_BIN_PREFIX) ++ install -m 755 rc.apparmor.functions ${DESTDIR}/usr/libexec + $(MAKE) -C po install NAME=${NAME} DESTDIR=${DESTDIR} + $(MAKE) install_manpages DESTDIR=${DESTDIR} + diff --git a/sys-apps/apparmor/files/apparmor-init-1 b/sys-apps/apparmor/files/apparmor-init-1 new file mode 100644 index 000000000000..4addaee294b3 --- /dev/null +++ b/sys-apps/apparmor/files/apparmor-init-1 @@ -0,0 +1,88 @@ +#!/sbin/openrc-run +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +description="Load all configured profiles for the AppArmor security module." +description_reload="Reload all profiles" + +extra_started_commands="reload" + +aa_action() { + local arg=$1 + local return + + shift + $* + return=$? + + if [ ${return} -eq 0 ]; then + aa_log_success_msg $arg + else + aa_log_failure_msg arg + fi + + return $return +} + +aa_log_action_start() { + ebegin $1 +} + +aa_log_action_end() { + eend $1 +} + +aa_log_success_msg() { + einfo $1 +} + +aa_log_warning_msg() { + ewarn $1 +} + +aa_log_failure_msg() { + eerror $1 +} + +aa_log_skipped_msg() { + einfo $1 +} + +aa_log_daemon_msg() { + einfo $1 +} + +aa_log_end_msg() { + eend $1 +} + +. /usr/libexec/rc.apparmor.functions + +start() { + ebegin "Starting AppArmor" + eindent + + if ! is_apparmor_loaded ; then + eerror "AppArmor kernel support is not present" + eend 1 + return 1 + fi + + parse_profiles load + + eoutdent +} + +stop() { + ebegin "Stopping AppArmor" + eindent + apparmor_stop + eoutdent +} + +reload() { + # todo: split out clean_profiles into its own function upstream + # so we can do parse_profiles reload && clean_profiles + # and do a proper reload instead of restart + apparmor_restart +} |