# apparmor.d - Full set of apparmor profiles
# 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} = /usr/share/code-{features,marketplace}/patch.py
profile pacman-hook-code @{exec_path} {
  include <abstractions/base>
  include <abstractions/python>

  capability dac_read_search,

  @{exec_path} mr,

  @{bin}/env r,
  @{bin}/python3.@{int} rix,

  @{lib}/code/product.json rw,

  /usr/share/code-{features,marketplace}/{,*} r,
  /usr/share/code-{features,marketplace}/cache.json rw,

  include if exists <local/pacman-hook-code>
}

# vim:syntax=apparmor
