16
18
# for details, see http://www.debian.org/doc/debian-policy/ or
17
19
# the debian-policy package
19
# On kernel upgrade, the apparmor init script loses its mind because the
20
# apparmor modules haven't been loaded. Ignore this, so that package
21
# upgrades or uninstalls don't fail.
22
ignore_apparmor_init_failure()
25
echo " The apparmor init script failed. Perhaps the apparmor modules"
26
echo " need to be installed? Try the following:"
27
echo " apt-get install apparmor-modules-source"
28
echo " m-a -v -t prepare"
29
echo " m-a -v -t -f build apparmor-modules"
30
echo " m-a -v -t -f install apparmor-modules"
22
configure|abort-remove|abort-deconfigure)
24
# Try to determine values for apparmor/homedirs if the administrator
26
if dpkg --compare-versions "$2" lt-nl "2.5~pre+bzr1362-0ubuntu2"; then
27
db_get apparmor/homedirs
28
if [ -z "$RET" ]; then
29
# Get unique dirnames for uids between 1000 and 30000, then
30
# format them appropriately for AppArmor
31
dirs=`awk -F: '$3 >= 1000 && $3 < 30000 {printf "%s\n", $6}' /etc/passwd | xargs -d '\n' -n 1 dirname | grep -v '^/home$' | sed -e 's#\(.*\)#\\1/#g' | sed -e '/ / { s#\(.*\)#"\\1"#g }' | sort -u | tr '\n' ' '`
32
if [ -n "$dirs" ]; then
33
db_set apparmor/homedirs "$dirs"
38
db_get apparmor/homedirs
41
# This file is auto-generated. It is recommended you update it using:
42
# $ sudo dpkg-reconfigure apparmor
44
# The following is a space-separated list of where additional user home
45
# directories are stored, each must have a trailing '/'. Directories added
46
# here are appended to @{HOMEDIRS}. See tunables/home for details.
48
if [ -n "$RET" ]; then
57
mkdir -p /etc/apparmor.d/tunables/home.d 2>/dev/null || true
58
mv -f "$tmp" /etc/apparmor.d/tunables/home.d/ubuntu
59
chmod 644 /etc/apparmor.d/tunables/home.d/ubuntu
67
echo "postinst called with unknown argument \`$1'" >&2
72
# drop old scripts that were incorrectly installed as conffiles
73
if dpkg-maintscript-helper supports rm_conffile; then
74
dpkg-maintscript-helper rm_conffile /etc/apparmor/functions 2.5.1-0ubuntu4 -- "$@"
75
dpkg-maintscript-helper rm_conffile /etc/apparmor/rc.apparmor.functions 2.5.1-0ubuntu4 -- "$@"
35
78
# dh_installdeb will replace this with shell code automatically
36
79
# generated by other debhelper scripts.
83
# Now that AppArmor is started, attempt to reload profiles in the
84
# case of upgrades (since dh_installinit has been forced not to unload
85
# the profiles in the case of an upgrade).
88
if [ -x "/etc/init.d/apparmor" ]; then
89
if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
90
invoke-rc.d apparmor reload || true
92
/etc/init.d/apparmor reload || true