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

# *Part of the `systemd` (as PID 1) profile.*
#
# `sd-umount` is a subprofile of `sd` responsible to handle unmounting operation.
#
# !!! info
#
#     Distributions and other programs can add rules in the `usr/sd-umount.d` directory
#

abi <abi/4.0>,

include <tunables/global>

@{exec_path} = @{bin}/umount
@{att} = ""
profile sd-umount flags=(complain) {
  include <abstractions/base-strict>

  capability sys_admin,

  umount @{efi},

  @{exec_path} mr,

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

  include if exists <usr/sd-umount.d>
  include if exists <local/sd-umount>
}

# vim:syntax=apparmor
