# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2021-2024 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only

abi <abi/4.0>,

include <tunables/global>

@{exec_path} = @{bin}/systemd-mount
@{exec_path} += @{bin}/systemd-umount
profile systemd-mount /{{,usr/}{,s}bin/systemd-mount,{,usr/}{,s}bin/systemd-umount} flags=(complain) {
  include <abstractions/base>
  include <abstractions/disks-write>

  @{exec_path} mr,

  @{bin}/less  rPx -> child-pager,
  @{bin}/more  rPx -> child-pager,
  @{bin}/pager rPx -> child-pager,

  @{sys}/bus/ r,
  @{sys}/class/ r,

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

  include if exists <local/systemd-mount>
}
