# 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/4.0>,

include <tunables/global>

@{exec_path} = @{bin}/install-catalog
@{att} = ""
profile install-catalog /{,usr/}bin/install-catalog {
  include <abstractions/base-strict>

  capability dac_read_search,

  @{exec_path} mr,

  @{sh_path}       rix,
  @{bin}/basename  rix,
  @{bin}/{,e}grep  rix,
  @{bin}/mv        rix,
  @{bin}/rm        rix,
  @{bin}/sed       rix,

  /etc/sgml/catalog{,.new} rw,
  /etc/sgml/sgml-docbook.cat{,.new} rw,
  /etc/sgml/sgml-ent.cat{,.new} rw,

  include if exists <local/install-catalog>
}

# vim:syntax=apparmor
