# apparmor.d - Full set of apparmor profiles
# 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}/glib-compile-schemas @{lib}/@{multiarch}/glib-2.0/glib-compile-schemas
@{att} = ""
profile glib-compile-schemas /{{,usr/}bin/glib-compile-schemas,{,usr/}lib{,exec,32,64}/*-linux-gnu*/glib-2.0/glib-compile-schemas} flags=(complain) {
  include <abstractions/base-strict>
  include <abstractions/consoles>

  network inet stream,
  network inet6 stream,

  @{exec_path} mr,

  @{system_share_dirs}/ r,
  @{system_share_dirs}/glib-2.0/schemas/{,*} r,
  @{system_share_dirs}/glib-2.0/schemas/gschemas.compiled rw,
  @{system_share_dirs}/glib-2.0/schemas/gschemas.compiled.@{rand6} rw,

  /usr/share/gnome-shell/extensions/*/schemas/org.gnome.shell.extensions.*.gschema.xml r,

  owner @{user_share_dirs}/gnome-shell/extension{,-updates}/*/schemas/ r,
  owner @{user_share_dirs}/gnome-shell/extension{,-updates}/*/schemas/gschemas.compiled rw,
  owner @{user_share_dirs}/gnome-shell/extension{,-updates}/*/schemas/gschemas.compiled.@{rand6} rw,

  include if exists <local/glib-compile-schemas>
}

# vim:syntax=apparmor
