Skip to content

Commit

Permalink
Use dh_apparmor for installing profile
Browse files Browse the repository at this point in the history
dh_apparmor generates the appropriate postinst and postrm snippets for
(re)loading apparmor profiles in a way that seems more robust than our
current usage of `aa-enforce`.

If apparmor isn't enabled, then it gracefully skips instead of aborting
the installation. This allows for installing the client package in
contexts where apparmor isn't available, like containers.

Fixes #1853.
  • Loading branch information
legoktm committed Feb 21, 2024
1 parent 5f76f10 commit 1262013
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ Source: securedrop-client
Section: unknown
Priority: optional
Maintainer: SecureDrop Team <[email protected]>
Build-Depends: debhelper-compat (= 11), python3-virtualenv
Build-Depends: debhelper-compat (= 11), dh-apparmor, python3-virtualenv
Standards-Version: 3.9.8
Homepage: https://github.com/freedomofpress/securedrop-client
X-Python3-Version: >= 3.5

Package: securedrop-client
Architecture: all
Depends: ${python3:Depends},${misc:Depends}, python3-pyqt5, python3-pyqt5.qtsvg, apparmor-utils
Depends: ${python3:Depends},${misc:Depends}, python3-pyqt5, python3-pyqt5.qtsvg
Description: securedrop client for qubes workstation

Package: securedrop-export
Expand Down
1 change: 1 addition & 0 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ override_dh_auto_install:
bash ./debian/setup-venv.sh log
bash ./debian/setup-venv.sh proxy
dh_auto_install
dh_apparmor --profile-name=usr.bin.securedrop-client -psecuredrop-client

override_dh_strip_nondeterminism:
find ./debian/ -type f -name '*.pyc' -delete
Expand Down
1 change: 0 additions & 1 deletion debian/securedrop-client.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ case "$1" in
configure)

update-desktop-database /usr/share/applications
aa-enforce /usr/bin/securedrop-client
;;

abort-upgrade|abort-remove|abort-deconfigure)
Expand Down

0 comments on commit 1262013

Please sign in to comment.