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

abi <abi/4.0>,

include <tunables/global>

@{exec_path} = @{bin}/xdg-desktop-icon
@{att} = ""
profile xdg-desktop-icon /{,usr/}bin/xdg-desktop-icon flags=(complain) {
  include <abstractions/base-strict>
  include <abstractions/freedesktop.org>

  @{exec_path} r,

  @{sh_path}       rix,
  @{bin}/{,e}grep   ix,
  @{bin}/basename   ix,
  @{bin}/cat        ix,
  @{bin}/chmod      ix,
  @{bin}/cp         ix,
  @{bin}/cut        ix,
  @{bin}/mkdir      ix,
  @{bin}/readlink   ix,
  @{bin}/realpath   ix,
  @{bin}/rm         ix,
  @{bin}/sed        ix,
  @{bin}/tr         ix,
  @{bin}/umask      ix,
  @{bin}/uname      ix,

  # To get DE information
  @{bin}/kde{,4}-config       ix,

  @{bin}/dbus-send            cx -> bus,
  @{bin}/xprop                px,

  profile bus  flags=(complain) {
    include <abstractions/base-strict>
    include <abstractions/app/bus>
    include <abstractions/bus-session>

    include if exists <local/xdg-desktop-icon_bus>
  }

  include if exists <local/xdg-desktop-icon>
}

# vim:syntax=apparmor
