morgan pushed to branch main at The Tor Project / Applications / tor-browser-build

Commits:

1 changed file:

Changes:

  • projects/linux-packages/debian/postinst.in
    ... ... @@ -2,11 +2,22 @@
    2 2
     
    
    3 3
     set -e
    
    4 4
     
    
    5
    +apparmor_profile='/etc/apparmor.d/[% c("var/system_pkg/pkg_name") %]'
    
    6
    +
    
    5 7
     case "$1" in
    
    6 8
         install|upgrade|configure)
    
    7 9
             # If abi 4.0 is not present, then remove the apparmor profile config
    
    8 10
             if [ ! -e /etc/apparmor.d/abi/4.0 ]; then
    
    9
    -            rm -f /etc/apparmor.d/[% c("var/system_pkg/pkg_name") %]
    
    11
    +            rm -f "$apparmor_profile"
    
    10 12
             fi
    
    11 13
             ;;
    
    12 14
     esac
    
    15
    +
    
    16
    +if [ "$1" = "configure" ]; then
    
    17
    +  if [ -f "$apparmor_profile" ]; then
    
    18
    +    # Reload the profile, including any abstraction updates
    
    19
    +    if aa-enabled --quiet 2>/dev/null; then
    
    20
    +      apparmor_parser -r -T -W "$apparmor_profile" || true
    
    21
    +    fi
    
    22
    +  fi
    
    23
    +fi