Accepting request 1147928 from home:fcrozat:branches:security:apparmor

- Update macro to detect when installing in chroot
  (transactional-update) and avoid calling apparmor_parser.

OBS-URL: https://build.opensuse.org/request/show/1147928
OBS-URL: https://build.opensuse.org/package/show/security:apparmor/apparmor-rpm-macros?expand=0&rev=15
This commit is contained in:
Christian Boltz 2024-02-20 12:39:50 +00:00 committed by Git OBS Bridge
parent 02e31a5e14
commit 5adf8c6842
3 changed files with 15 additions and 5 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Feb 20 12:15:28 UTC 2024 - Frederic Crozat <fcrozat@suse.com>
- Update macro to detect when installing in chroot
(transactional-update) and avoid calling apparmor_parser.
-------------------------------------------------------------------
Sat Jun 3 14:30:51 UTC 2023 - Georg Pfuetzenreuter <georg.pfuetzenreuter@suse.com>

View File

@ -1,7 +1,7 @@
#
# spec file for package apparmor-rpm-macros
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed

View File

@ -1,7 +1,11 @@
%apparmor_reload()\
if [ "$YAST_IS_RUNNING" != "instsys" -a -x /usr/bin/systemctl ]; then\
if /usr/bin/systemctl is-active --quiet apparmor.service; then\
/sbin/apparmor_parser -r -T -W %{?*} > /dev/null || :\
fi\
if [ "$YAST_IS_RUNNING" != "instsys" -a -x /usr/bin/systemd-detect-virt -a -x /usr/bin/systemctl ]; then\
systemd-detect-virt --chroot --quiet \
NOT_IN_CHROOT=$? \
if [ $NOT_IN_CHROOT -gt 0 ]; then \
if /usr/bin/systemctl is-active --quiet apparmor.service; then\
/sbin/apparmor_parser -r -T -W %{?*} > /dev/null || :\
fi\
fi \
fi\
%{nil}