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

include <tunables/global>

@{exec_path} = @{lib}/needrestart/apt-pinvoke
profile needrestart-apt-pinvoke @{exec_path} {
  include <abstractions/base>
  include <abstractions/bus-system>
  include <abstractions/bus/org.freedesktop.login1>
  include <abstractions/consoles>

  @{exec_path} mr,

  @{sh_path}              rix,
  @{bin}/dbus-send        rix,
  @{bin}/needrestart      rPx,
  @{bin}/rm               rix,

  @{run}/needrestart/{,**} rw,

  include if exists <local/needrestart-apt-pinvoke>
}