# 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}/loginctl
profile loginctl @{exec_path} {
  include <abstractions/base>
  include <abstractions/consoles>
  include <abstractions/bus-system>
  include <abstractions/common/systemd>

  capability net_admin,
  capability sys_resource,

  signal send set=cont peer=child-pager,

  #aa:dbus talk bus=system name=org.freedesktop.login1 label=systemd-logind

  @{exec_path} mr,

  @{pager_path} rPx -> child-pager,

        @{PROC}/sys/fs/nr_open r,
  owner @{PROC}/@{pid}/cgroup r,

  include if exists <local/loginctl>
}

# vim:syntax=apparmor
