~ubuntu-branches/ubuntu/precise/maas-provision/precise-updates

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh
set -e

disable_profile() {
    APP_CONFFILE="/etc/apparmor.d/usr.bin.cobblerd"
    APP_DISABLE="/etc/apparmor.d/disable/usr.bin.cobblerd"
    # Create a symlink to the yet-to-be-unpacked profile
    if [ ! -e "$APP_CONFFILE" ]; then
        mkdir -p `dirname $APP_DISABLE` 2>/dev/null || true
        ln -sf $APP_CONFFILE $APP_DISABLE
    fi
}

# Fix world-readable permissions on /etc/cobbler/users.digest if upgrading
# from a version which had it set incorrectly by default, the file is still
# there and still has the original incorrect permissions (LP: #858860).

if [ "$1" = "install" ]; then
    # Disable AppArmor profile on install
    disable_profile
elif [ "$1" = "upgrade" ] \
     && dpkg --compare-versions "$2" lt "2.2.2-0ubuntu14" \
     && [ -f /etc/cobbler/users.digest \
     -a `stat -c%a /etc/cobbler/users.digest` = "644" ]; then
	chmod 600 /etc/cobbler/users.digest
fi

#DEBHELPER#