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

abi <abi/3.0>,

include <tunables/global>

@{exec_path} = @{bin}/utox
profile utox @{exec_path} {
  include <abstractions/base>
  include <abstractions/audio-client>
  include <abstractions/dconf-write>
  include <abstractions/desktop>
  include <abstractions/fontconfig-cache-read>
  include <abstractions/nameservice-strict>
  include <abstractions/user-download-strict>
  include <abstractions/video>

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

  @{exec_path} mr,

  @{open_path} rCx -> child-open,

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

  owner @{HOME}/ r,
  owner @{user_config_dirs}/tox/ rw,
  owner @{user_config_dirs}/tox/** rw,

  deny owner @{PROC}/@{pid}/cmdline r,

  include if exists <local/utox>
}

# vim:syntax=apparmor
