# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2020-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}/cawbird
profile cawbird @{exec_path} {
  include <abstractions/base>
  include <abstractions/audio-client>
  include <abstractions/dconf-write>
  include <abstractions/enchant>
  include <abstractions/fontconfig-cache-read>
  include <abstractions/fonts>
  include <abstractions/freedesktop.org>
  include <abstractions/gstreamer>
  include <abstractions/gtk>
  include <abstractions/nameservice-strict>
  include <abstractions/ssl_certs>

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

  @{exec_path} mr,

  @{sh_path}         rix,

  @{open_path}       rPx -> child-open,

  /usr/share/xml/iso-codes/{,**} r,

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

  owner @{user_config_dirs}/cawbird/ rw,
  owner @{user_config_dirs}/cawbird/** rwk,

  owner @{user_cache_dirs}/ rw,
  owner @{user_cache_dirs}/cawbird-* rw,

  owner @{PROC}/@{pid}/fd/ r,

  include if exists <local/cawbird>
}

# vim:syntax=apparmor
