# 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} = @{lib}/systemd/system-sleep/grub2.sleep
profile systemd-sleep-grub /{,usr/}lib{,exec,32,64}/systemd/system-sleep/grub2.sleep flags=(complain) {
  include <abstractions/base>

  @{exec_path} mr,

  @{sh_path}              rix,
  @{bin}/grep             rix,
  @{bin}/uname            rix,

  /etc/sysconfig/bootloader r,

  /var/lib/nscd/passwd r,

  @{PROC}/@{pid}/maps r,

  /dev/tty rw,

  include if exists <local/systemd-sleep-grub>
}