# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2026 Łukasz Kozak <lakis.kozak@gmail.com>
# SPDX-License-Identifier: GPL-2.0-only

abi <abi/4.0>,

include <tunables/global>

@{exec_path} = @{lib}/kf6/kauth/{,libexec/}plymouthhelper
@{att} = ""
profile kauth-plymouthhelper /{,usr/}lib{,exec,32,64}/kf6/kauth/{,libexec/}plymouthhelper {
  include <abstractions/base-strict>
  include <abstractions/bus-system>
  include <abstractions/bus/system/org.freedesktop.PolicyKit1>
  include <abstractions/mime>
  include <abstractions/nameservice-strict>
  include <abstractions/qt>

  capability dac_read_search,

  #aa/dbus own bus=system name=org.kde.kcontrol.kcmplymouth path=/ interface+=org.kde.kf[56]auth
  include <abstractions/bus/system/own>
  dbus bind bus=system name=org.kde.kcontrol.kcmplymouth{,.*},
  dbus receive bus=system path=/
       interface=org.kde.kcontrol.kcmplymouth{,.*}
       peer=(name="@{busname}"),
  dbus send bus=system path=/
       interface=org.kde.kcontrol.kcmplymouth{,.*}
       peer=(name="{@{busname},org.freedesktop.DBus}"),
  dbus receive bus=system path=/
       interface=org.kde.kf[56]auth
       peer=(name="@{busname}"),
  dbus send bus=system path=/
       interface=org.kde.kf[56]auth
       peer=(name="{@{busname},org.freedesktop.DBus}"),
  # DBus.Properties: reply to properties request from anyone
  dbus (send receive) bus=system path=/
       interface=org.freedesktop.DBus.Properties
       member={Get,GetAll,Set,PropertiesChanged}
       peer=(name="{@{busname},org.freedesktop.DBus}"),
  # DBus.Introspectable: allow clients to introspect the service
  dbus receive bus=system path=/
       interface=org.freedesktop.DBus.Introspectable
       member=Introspect
       peer=(name="@{busname}"),
  # DBus.ObjectManager: allow clients to enumerate sources
  dbus receive bus=system path=/
       interface=org.freedesktop.DBus.ObjectManager
       member=GetManagedObjects
       peer=(name="{@{busname},org.kde.kcontrol.kcmplymouth{,.*}}"),
  dbus send bus=system path=/
       interface=org.freedesktop.DBus.ObjectManager
       member={InterfacesAdded,InterfacesRemoved}
       peer=(name="{@{busname},org.freedesktop.DBus}"),


  @{exec_path} mr,



  /usr/share/plymouth/themes/** rw,

  @{user_share_dirs}/kplymouththemeinstaller/*.@{archive_ext} r,

  @{tmp}/#@{int} rw,

  include if exists <local/kauth-plymouthhelper>
}

# vim:syntax=apparmor
