# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2025 valoq <valoq@mailbox.org>
# SPDX-License-Identifier: GPL-2.0-only

abi <abi/4.0>,

include <tunables/global>

@{exec_path} = @{bin}/pdftoppm
@{att} = ""
profile pdftoppm /{,usr/}bin/pdftoppm flags=(complain) {
  include <abstractions/base-strict>
  include <abstractions/fonts>
  include <abstractions/user-read-strict>
  include <abstractions/user-write-strict>

  @{exec_path} mr,

  /usr/share/poppler/{,**} r,

  owner /tmp/{,**}.ppm w,
  owner /tmp/{,**}.png w,
  owner /tmp/{,**}.jpg w,
  owner /tmp/{,**}.jpeg w,
  owner /tmp/{,**}.tiff w,

  include if exists <local/pdftoppm>
}

# vim:syntax=apparmor
