Kaydet (Commit) d0841a18 authored tarafından Rene Engelhard's avatar Rene Engelhard

test apparmor profile parsing (see tdf#114915)

idea taken from
https://salsa.debian.org/apparmor-team/apparmor-profiles-extra/commit/7fbcc4788d0e94764eeeff2f080796601241f986#546c1096cd506dbb01a47ed87a636a8e94d83b8c

Change-Id: I7e5bda9224d69530af4d30422c2fd3d60c9929d6
Reviewed-on: https://gerrit.libreoffice.org/55770
Tested-by: Jenkins
Tested-by: 's avatarRene Engelhard <rene@debian.org>
Reviewed-by: 's avatarOlivier Tilloy <olivier.tilloy@canonical.com>
Reviewed-by: 's avatarRene Engelhard <rene@debian.org>
üst 2963e0c6
......@@ -19,16 +19,17 @@ INST_ROOT=$1 #Where libreoffice program folder can be found
PROFILESFROM=$2 #Where the profile files are
INSTALLTO=$3 #Where should the apparmor profiles (For manual use should be /etc/apparmor.d)
RESTART=$4 #Should we restart apparmor using service?
CHECK=$5 #Check parsing of the new profile?
#Example uses:
#Ubuntu 16.04 with stock LibreOffice:
# sudo ./sysui/desktop/share/apparmor.sh /usr/lib/libreoffice/ sysui/desktop/apparmor/ /etc/apparmor.d/ true
# sudo ./sysui/desktop/share/apparmor.sh /usr/lib/libreoffice/ sysui/desktop/apparmor/ /etc/apparmor.d/ true true
#Ubuntu 16.04, with built debs from LibreOffice git
# sudo ./sysui/desktop/share/apparmor.sh /opt/libreofficedev5.2/ sysui/desktop/apparmor/ /etc/apparmor.d/ true
# sudo ./sysui/desktop/share/apparmor.sh /opt/libreofficedev5.2/ sysui/desktop/apparmor/ /etc/apparmor.d/ true true
#Ubuntu 16.04, running from git!
# sudo ./sysui/desktop/share/apparmor.sh /mnt/store/git/libo/instdir/ sysui/desktop/apparmor/ /etc/apparmor.d/ true
# sudo ./sysui/desktop/share/apparmor.sh /mnt/store/git/libo/instdir/ sysui/desktop/apparmor/ /etc/apparmor.d/ true true
#Need to convert / to . for profile names
INST_ROOT_FORMAT=${INST_ROOT/\//}
......@@ -43,7 +44,11 @@ do
tourl=$INSTALLTO$INST_ROOT_FORMAT${filename##*/}
sed "s/INSTDIR-/$INST_ROOT_SED/g" "$filename" > "$tourl"
echo "$tourl"
if [ "$CHECK" = "true" ]; then
# check profile parsing
echo "Checking $tourl profile."
/sbin/apparmor_parser --add --skip-cache --skip-kernel-load $tourl
fi
done
if [ "$RESTART" = true ] ; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment