[Libreoffice-commits] core.git: sysui/desktop

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Aug 10 07:10:06 UTC 2018


 sysui/desktop/share/apparmor.sh |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

New commits:
commit d0841a1828dad5d9aa1ce92b234092e9b1180d31
Author:     Rene Engelhard <rene at debian.org>
AuthorDate: Wed Jun 13 21:37:12 2018 +0200
Commit:     Rene Engelhard <rene at debian.org>
CommitDate: Fri Aug 10 09:09:43 2018 +0200

    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: Rene Engelhard <rene at debian.org>
    Reviewed-by: Olivier Tilloy <olivier.tilloy at canonical.com>
    Reviewed-by: Rene Engelhard <rene at debian.org>

diff --git a/sysui/desktop/share/apparmor.sh b/sysui/desktop/share/apparmor.sh
index 253fe87cf78d..c801f0f3b217 100755
--- a/sysui/desktop/share/apparmor.sh
+++ b/sysui/desktop/share/apparmor.sh
@@ -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


More information about the Libreoffice-commits mailing list