Permalink
Browse files

Merge pull request #11 from ubuntu-core/fix-postinst

Fix maintainer script not to fail if profile is not loaded
  • Loading branch information...
2 parents ec60dac + 46fa72b commit 3b85e3ec42a2ac837be48f78005d78248903161c @mvo5 mvo5 committed May 31, 2016
Showing with 3 additions and 1 deletion.
  1. +3 −1 debian/ubuntu-core-launcher.postinst
@@ -8,7 +8,9 @@ case $1 in
configure)
# remove current profile so that the pass-through can still run
if [ -e /sys/kernel/security/apparmor/.remove ]; then
- echo -n '/usr/bin/ubuntu-core-launcher' > /sys/kernel/security/apparmor/.remove
+ if grep -q "^/usr/bin/ubuntu-core-launcher ([[:alpha:]]+)$" /sys/kernel/security/apparmor/profiles; then
+ echo -n '/usr/bin/ubuntu-core-launcher' > /sys/kernel/security/apparmor/.remove
+ fi
fi
;;
esac

1 comment on commit 3b85e3e

Contributor

jdstrand commented on 3b85e3e May 31, 2016

This isn't right. It should be:
if egrep -q '^/usr/bin/ubuntu-core-launcher \([[:alpha:]]+\)$' /sys/kernel/security/apparmor/profiles; then

Please sign in to comment.