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

abi <abi/3.0>,

include <tunables/global>

@{exec_path} = @{bin}/file-roller
profile file-roller @{exec_path} {
  include <abstractions/base>
  include <abstractions/bus-accessibility>
  include <abstractions/bus/org.a11y>
  include <abstractions/bus/org.freedesktop.portal.Desktop>
  include <abstractions/common/gnome>
  include <abstractions/nameservice-strict>
  include <abstractions/user-download-strict>
  include <abstractions/user-read-strict>
  include <abstractions/user-write-strict>

  #aa:dbus own bus=session name=org.gnome.ArchiveManager1
  #aa:dbus own bus=session name=org.gnome.FileRoller

  @{exec_path} mr,

  # Archivers
  @{bin}/7z            rix,
  @{bin}/ar            rix,
  @{bin}/bzip2         rix,
  @{bin}/cpio          rix,
  @{bin}/gzip          rix,
  @{bin}/tar           rix,
  @{bin}/unrar-nonfree rix,
  @{bin}/unzip         rix,
  @{bin}/xz            rix,
  @{bin}/zip           rix,
  @{bin}/zstd          rix,
  @{lib}/p7zip/7z      rix,

  @{run}/mount/utab r,

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

  include if exists <local/file-roller>
}