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

abi <abi/4.0>,

include <tunables/global>

@{exec_path} = @{bin}/xprop
profile xprop /{,usr/}{,s}bin/xprop flags=(complain) {
  include <abstractions/base>

  @{exec_path} mr,

  /usr/etc/X11/xdm/Xresources r,
  /usr/share/icons/*/cursors/crosshair r,

  owner @{HOME}/.Xauthority r,
  owner @{HOME}/.icons/default/index.theme r,
  
  owner /tmp/runtime-*/xauth_@{rand6} r,
  owner /tmp/xauth_@{rand6} r,

  owner @{run}/user/@{uid}/xauth_@{rand6} rl,

  # file_inherit
  owner /dev/tty@{int} rw,
  owner @{HOME}/.xsession-errors w,

  include if exists <local/xprop>
}
