# 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}/strawberry-tagreader
@{att} = ""
profile strawberry-tagreader /{,usr/}bin/strawberry-tagreader flags=(complain) {
  include <abstractions/base-strict>
  include <abstractions/consoles>
  include <abstractions/ssl_certs>

  signal (receive) set=(term, kill) peer=strawberry,
  signal (receive) set=(term, kill) peer=anyremote//*,

  @{exec_path} mr,

  # Media library
  owner @{user_music_dirs}/ r,
  owner @{user_music_dirs}/** rw,

  # file_inherit
  owner @{HOME}/.xsession-errors w,
  owner @{HOME}/.anyRemote/anyremote.stdout w,
  owner @{user_cache_dirs}/gstreamer-@{int}/registry.*.bin{,.tmp@{rand6}} rw,

  include if exists <local/strawberry-tagreader>
}

# vim:syntax=apparmor
