# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2020-2021 Mikhail Morfikov
# 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} = @{bin}/dpkg-genbuildinfo
profile dpkg-genbuildinfo @{exec_path} {
  include <abstractions/base>
  include <abstractions/consoles>
  include <abstractions/perl>

  capability dac_override,

  @{exec_path} r,

  @{bin}/perl r,
  /usr/local/bin/ r,
  /usr/local/etc/ r,
  /usr/local/include/ r,
  /usr/local/lib/ r,
  /usr/local/lib/**/ r,
  /usr/local/sbin/ r,

  /usr/share/dpkg/abitable r,
  /usr/share/dpkg/cputable r,
  /usr/share/dpkg/tupletable r,
  /usr/share/lto-disabled-list/lto-disabled-list r,

  /etc/dpkg/origins/* r,

  /var/lib/dpkg/status r,

  owner @{user_config_dirs}/dpkg/buildflags.conf r,

  owner @{user_build_dirs}/** rwkl -> @{user_build_dirs}/**,

  include if exists <local/dpkg-genbuildinfo>
}

# vim:syntax=apparmor
