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

« back to all changes in this revision

Viewing changes to debian/maas-provision.preinst

  • Committer: Package Import Robot
  • Author(s): Andres Rodriguez
  • Date: 2012-04-20 13:19:26 UTC
  • Revision ID: package-import@ubuntu.com-20120420131926-at0afop7h821ulan
Tags: 2.2.2-0ubuntu2
* debian/maas-provision.install: Do not install tftpd (LP: #985094)
* Add apparmor profile (LP: #975442)
  - debian/usr.bin.cobblerd: Add profile.
  - debian/rules: Install profile.
  - debian/maas-provision.preinst: Disable profile on install.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/sh
2
2
set -e
3
3
 
 
4
disable_profile() {
 
5
    APP_CONFFILE="/etc/apparmor.d/usr.bin.cobblerd"
 
6
    APP_DISABLE="/etc/apparmor.d/disable/usr.bin.cobblerd"
 
7
    # Create a symlink to the yet-to-be-unpacked profile
 
8
    if [ ! -e "$APP_CONFFILE" ]; then
 
9
        mkdir -p `dirname $APP_DISABLE` 2>/dev/null || true
 
10
        ln -sf $APP_CONFFILE $APP_DISABLE
 
11
    fi
 
12
}
 
13
 
4
14
# Fix world-readable permissions on /etc/cobbler/users.digest if upgrading
5
15
# from a version which had it set incorrectly by default, the file is still
6
16
# there and still has the original incorrect permissions (LP: #858860).
7
17
 
8
 
if [ "$1" = "upgrade" ] \
 
18
if [ "$1" = "install" ]; then
 
19
    # Disable AppArmor profile on install
 
20
    disable_profile
 
21
elif [ "$1" = "upgrade" ] \
9
22
     && dpkg --compare-versions "$2" lt "2.2.2-0ubuntu14" \
10
23
     && [ -f /etc/cobbler/users.digest \
11
24
     -a `stat -c%a /etc/cobbler/users.digest` = "644" ]; then