# 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/4.0>,

include <tunables/global>

@{exec_path} = @{bin}/ksplashqml
profile ksplashqml /{,usr/}{,s}bin/ksplashqml flags=(complain) {
  include <abstractions/base>
  include <abstractions/graphics>
  include <abstractions/kde-strict>
  include <abstractions/nameservice-strict>
  include <abstractions/qt5-shader-cache>

  @{exec_path} mr,

  @{lib}/libheif/            r,
  @{lib}/libheif/*.so*      rm,

  /usr/share/plasma/** r,

  /etc/machine-id r,

  owner @{user_cache_dirs}/icon-cache.kcache rw,
  owner @{user_cache_dirs}/ksplash/ rw,
  owner @{user_cache_dirs}/ksplash/** rwlk -> @{user_cache_dirs}/ksplash/**,

  owner @{user_config_dirs}/kdedefaults/ksplashrc r,
  owner @{user_config_dirs}/kdedefaults/plasmarc r,

  @{PROC}/sys/kernel/core_pattern r,

  include if exists <local/ksplashqml>
}
