20
APP_PROFILE="usr.sbin.slapd"
21
APP_CONFFILE="/etc/apparmor.d/$APP_PROFILE"
22
APP_COMPLAIN="/etc/apparmor.d/force-complain/$APP_PROFILE"
23
if [ "$1" = "upgrade" ]; then
24
mkdir -p `dirname $APP_COMPLAIN` 2>/dev/null || true
25
if dpkg --compare-versions $2 lt 2.3.30-2 ; then
26
# force-complain for pre-apparmor upgrades
27
ln -sf $APP_CONFFILE $APP_COMPLAIN
28
elif dpkg --compare-versions $2 lt 2.4.7-5ubuntu1 ; then
29
if [ -e "$APP_CONFFILE" ]; then
30
md5sum="`md5sum \"$APP_CONFFILE\" | sed -e \"s/ .*//\"`"
31
pkg_md5sum="`sed -n -e \"/^Conffiles:/,/^[^ ]/{\\\\' $APP_CONFFILE'{s/.* //;p}}\" /var/lib/dpkg/status`"
32
if [ "$md5sum" = "$pkg_md5sum" ]; then
33
# force-complain on upgrade from pre-shipped profile and
34
# existing profile is same as in conffiles
35
ln -sf $APP_CONFFILE $APP_COMPLAIN
38
# force-complain on upgrade from pre-shipped profile and
39
# there is no existing profile
40
ln -sf $APP_CONFFILE $APP_COMPLAIN