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

abi <abi/3.0>,

include <tunables/global>

@{exec_path} = @{bin}/xdg-user-dir
profile xdg-user-dir @{exec_path} flags=(attach_disconnected) {
  include <abstractions/base>
  include <abstractions/nameservice-strict>

  @{exec_path} mr,

  @{sh_path}  rix,
  @{bin}/env  rix,

  owner @{user_config_dirs}/user-dirs.dirs r,

  /dev/tty rw,

  # Silencer
  deny network inet stream,
  deny network inet6 stream,
  deny @{user_share_dirs}/gvfs-metadata/* r,

  include if exists <local/xdg-user-dir>
}

# vim:syntax=apparmor
