# 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/zsh-theme-powerlevel[0-9]*k/gitstatus/usrbin/gitstatusd{,-*}
profile gitstatusd @{exec_path} {
  include <abstractions/base>

  @{exec_path} mr,

  owner @{user_projects_dirs}/{,**} r,
  owner @{user_projects_dirs}/**/.git/.gitstatus.@{rand6}/{,**} rw,

  owner @{HOME}/.gitconfig r,
  owner @{user_config_dirs}/git/{,*} r,

  # Silencer
  deny capability dac_read_search,
  deny capability dac_override,
  deny owner @{HOME}/.*-store/{,**} r,

  include if exists <local/gitstatusd>
}
