# 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}  = @{lib}/kf{5,6}/kiod{5,6}
@{exec_path} += @{lib}/@{multiarch}/{,libexec/}kf{5,6}/kiod{5,6}
profile kiod @{exec_path} {
  include <abstractions/base>
  include <abstractions/graphics>
  include <abstractions/kde-strict>
  include <abstractions/nameservice-strict>

  network netlink raw,

  @{exec_path} mr,

  /usr/share/icons/breeze/index.theme r,
  /usr/share/mime/{,**} r,

  owner @{user_cache_dirs}/icon-cache.kcache rw,

  owner @{user_config_dirs}/#@{int} rw,
  owner @{user_config_dirs}/ksslcertificatemanager rwl -> @{user_config_dirs}/#@{int},
  owner @{user_config_dirs}/ksslcertificatemanager.lock rwk,

  owner @{PROC}/@{pid}/mounts r,

  /dev/tty r,

  include if exists <local/kiod>
}