#!/bin/sh
set -e

# AppArmor currently does not allow us to access the system D-BUS from an
# unshared file system. Hack the policy to allow that until that gets fixed
# properly. See https://launchpad.net/bugs/1244157

[ -d "$ADTTMP" ]

sed '/nm-dhcp-client.action {/ s/{/flags=(attach_disconnected) {/' \
    /etc/apparmor.d/sbin.dhclient > "$ADTTMP/sbin.dhclient"
apparmor_parser -Kr "$ADTTMP/sbin.dhclient"
