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

abi <abi/3.0>,

include <tunables/global>

@{exec_path} = @{bin}/jackdbus
profile jackdbus @{exec_path} flags=(attach_disconnected) {
  include <abstractions/base>
  include <abstractions/bus-session>

  signal (receive) set=(term) peer=gdm,

  #aa:dbus own bus=session name=org.jackaudio.service

  @{exec_path} mr,

  owner @{DESKTOP_HOME}/.log/ w,
  owner @{DESKTOP_HOME}/.log/jack/{,**} rw,

  owner @{HOME}/.log/ w,
  owner @{HOME}/.log/jack/{,**} rw,

  owner @{user_config_dirs}/jack/{,**} rw,

  include if exists <local/jackdbus>
}

# vim:syntax=apparmor
