From 1d789dbe53fa5126ddabb1b1291822aa20631569 Mon Sep 17 00:00:00 2001 From: downtownallday Date: Tue, 2 Jun 2020 11:21:59 -0400 Subject: [PATCH] Don't apply apparmor configuration when apparmor is disabled (eg. travis-ci) --- .travis.yml | 4 ++-- setup/ldap.sh | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5c2070c5..de5141cf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,11 +10,11 @@ os: linux dist: bionic before_install: - - echo "Updating system" + - sudo aa-status - sudo apt-get update install: - - sudo ./setup/start.sh + - sudo ./setup/start.sh -v script: - sudo ./tests/runner.sh diff --git a/setup/ldap.sh b/setup/ldap.sh index 74d1d768..0d52aded 100755 --- a/setup/ldap.sh +++ b/setup/ldap.sh @@ -632,8 +632,10 @@ update_apparmor() { EOF chmod 0644 /etc/apparmor.d/local/usr.sbin.slapd - # Load settings into the kernel - apparmor_parser -r /etc/apparmor.d/usr.sbin.slapd + # Load settings into the kernel only if AppArmor is enabled + if aa-status --enabled; then + apparmor_parser -r /etc/apparmor.d/usr.sbin.slapd + fi }