# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2019-2021 Mikhail Morfikov
# Copyright (C) 2021-2024 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only

abi <abi/4.0>,

include <tunables/global>

@{exec_path} = @{bin}/quiterss
profile quiterss @{exec_path} {
  include <abstractions/base>
  include <abstractions/audio-client>
  include <abstractions/desktop>
  include <abstractions/fontconfig-cache-read>
  include <abstractions/graphics>
  include <abstractions/gstreamer>
  include <abstractions/nameservice-strict>
  include <abstractions/qt5-compose-cache-write>
  include <abstractions/qt5-settings-write>
  include <abstractions/ssl_certs>
  include <abstractions/user-download-strict>

  network inet dgram,
  network inet6 dgram,
  network inet stream,
  network inet6 stream,
  network netlink raw,
  network netlink dgram,

  @{exec_path} mr,

  @{open_path} rPx -> child-open,

  /usr/share/quiterss/** r,

  /etc/fstab r,
  /etc/machine-id r,
  /var/lib/dbus/machine-id r,

  owner @{user_config_dirs}/QuiteRss/ rw,
  owner @{user_config_dirs}/QuiteRss/** rwkl -> @{user_config_dirs}/QuiteRss/**,
  owner @{user_share_dirs}/QuiteRss/ rw,
  owner @{user_share_dirs}/QuiteRss/** rwkl -> @{user_share_dirs}/QuiteRss/QuiteRss/**,
  owner @{user_cache_dirs}/QuiteRss/ rw,
  owner @{user_cache_dirs}/QuiteRss/** rwl -> @{user_cache_dirs}/QuiteRss/**,

  owner @{tmp}/qtsingleapp-quiter-@{int}-@{int} rw,
  owner @{tmp}/qtsingleapp-quiter-@{int}-@{int}-lockfile rwk,
  owner /var/tmp/etilqs_@{hex16} rw,

        @{PROC}/sys/kernel/random/boot_id r,
  owner @{PROC}/@{pid}/cmdline r,
  owner @{PROC}/@{pid}/fd/ r,
  owner @{PROC}/@{pid}/mountinfo r,
  owner @{PROC}/@{pid}/mounts r,

  /dev/shm/#@{int} rw,

  owner /dev/tty@{int} rw,

  include if exists <local/quiterss>
}

# vim:syntax=apparmor
