[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [Git][tpo/applications/tor-browser-build][main] MB 415: Load apparmor profile when configuring deb package



Title: GitLab

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

Commits:

  • 27246fb1
    by Nicolas Vigier at 2025-03-27T15:03:36+00:00
    MB 415: Load apparmor profile when configuring deb package
    
    Use the command from /usr/share/debhelper/autoscripts/postinst-apparmor
    (from dh-apparmor package).
    

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

  • _______________________________________________
    tor-commits mailing list -- tor-commits@xxxxxxxxxxxxxxxxxxxx
    To unsubscribe send an email to tor-commits-leave@xxxxxxxxxxxxxxxxxxxx