# 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-environment-generators/60-flatpak-system-only
@{att} = ""
profile systemd-generator-environment-flatpak /{,usr/}lib{,exec,32,64}/systemd/system-environment-generators/60-flatpak-system-only flags=(complain) {
  include <abstractions/base-strict>
  include <abstractions/nameservice-strict>

  ptrace read peer=@{p_systemd},

  @{exec_path} mr,

  @{sh_path}         rix,
  @{bin}/flatpak     rix,

  /usr/{local/,}share/gvfs/remote-volume-monitors/{,*}  r,

  /dev/tty rw,

  include if exists <local/systemd-generator-environment-flatpak>
}

# vim:syntax=apparmor
