# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2024 valoq <valoq@mailbox.org>
# SPDX-License-Identifier: GPL-2.0-only

abi <abi/4.0>,

include <tunables/global>

@{exec_path} = @{bin}/ouch
profile ouch @{exec_path} {
  include <abstractions/base>
  include <abstractions/user-read-strict>
  include <abstractions/user-write-strict>

  @{exec_path} mr,

  owner @{HOME}/.tmp@{rand6}/{,**} rw,

  @{sys}/fs/cgroup/user.slice/cpu.max r,
  @{sys}/fs/cgroup/user.slice/user-@{uid}.slice/cpu.max r,
  @{sys}/fs/cgroup/user.slice/user-@{uid}.slice/session-@{int}.scope/cpu.max r,

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

  include if exists <local/ouch>
}

# vim:syntax=apparmor
