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

abi <abi/4.0>,

include <tunables/global>

@{exec_path} = @{bin}/gpo
@{att} = ""
profile gpo /{,usr/}bin/gpo flags=(complain) {
  include <abstractions/base-strict>
  include <abstractions/consoles>
  include <abstractions/nameservice-strict>
  include <abstractions/python>
  include <abstractions/sqlite>
  include <abstractions/ssl_certs>
  include <abstractions/user-download-strict>

  network inet dgram,
  network inet6 dgram,
  network inet stream,
  network inet6 stream,

  @{exec_path} r,
  @{python_path} r,

  @{bin}/ r,
  @{sh_path}        rix,
  @{bin}/uname      rix,
  @{pager_path} rpx -> child-pager,

  /etc/inputrc r,

  /usr/share/gpodder/extensions/{,*.py} r,

  owner @{HOME}/gPodder/ rw,
  owner @{HOME}/gPodder/** rwk,

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

  include if exists <local/gpo>
}

# vim:syntax=apparmor
