apparmor.d/apparmor.d/profiles-a-f/evince
Alexandre Pujol 3f69b9fec4
feat(profile): use the new @{tmp} variable.
It is only used with the owner statement.
2024-05-02 22:12:02 +01:00

68 lines
1.9 KiB
Plaintext

# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2022-2024 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = @{bin}/evince @{lib}/evinced
profile evince @{exec_path} {
include <abstractions/base>
include <abstractions/bus-accessibility>
include <abstractions/bus-session>
include <abstractions/bus/org.a11y>
include <abstractions/bus/org.freedesktop.FileManager1>
include <abstractions/bus/org.freedesktop.portal.Desktop>
include <abstractions/bus/org.gnome.SessionManager>
include <abstractions/dconf-write>
include <abstractions/gnome-strict>
include <abstractions/ibus>
include <abstractions/nameservice-strict>
include <abstractions/thumbnails-cache-write>
include <abstractions/user-download-strict>
include <abstractions/user-read-strict>
include <abstractions/user-write-strict>
# also denies network mounts
deny network inet,
deny network inet6,
#aa:dbus own bus=session name=org.gnome.evince
#aa:dbus talk bus=session name=org.gnome.SettingsDaemon.MediaKeys label=gsd-media-keys
dbus send bus=session path=/org/gtk/vfs/metadata
interface=org.gtk.vfs.Metadata
member={Set,GetTreeFromDevice}
peer=(name=:*, label=gvfsd-metadata),
@{exec_path} rix,
@{sh_path} rix,
@{open_path} rPx -> child-open,
/usr/share/djvu/{,**} r,
/usr/share/evince/{,**} r,
/usr/share/ghostscript/{,**} r,
/usr/share/poppler/{,**} r,
/usr/share/thumbnailers/{,*} r,
owner @{user_share_dirs}/ r,
owner @{user_share_dirs}/gvfs-metadata/{,*} r,
owner @{user_config_dirs}/evince/{,*} rw,
owner @{tmp}/*.pdf r,
owner @{tmp}/evince-*/{,**} rw,
owner @{tmp}/gtkprint* rw,
owner @{PROC}/@{pid}/fd/ r,
owner @{PROC}/@{pid}/mountinfo r,
/dev/tty rw,
deny @{lib}/ r, # asks when viewing PostScript files
include if exists <local/evince>
}