# 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/3.0>,

include <tunables/global>

@{lib_dirs} = @{lib}/signal-desktop "/opt/Signal{, Beta}"
@{config_dirs} = "@{user_config_dirs}/Signal{, Beta}"

@{exec_path} = @{lib_dirs}/chrome-sandbox
profile signal-desktop-chrome-sandbox @{exec_path} {
  include <abstractions/base>

  capability sys_admin,
  capability sys_chroot,

  @{exec_path} mr,

  @{lib_dirs}/signal-desktop{,-beta} rPx,

  @{PROC}/@{pid}/ r,
  @{PROC}/@{pid}/oom_adj w,
  @{PROC}/@{pid}/oom_score_adj w,

  include if exists <local/signal-desktop-chrome-sandbox>
}


# vim:syntax=apparmor
