# 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} = @{sbin}/pwck
@{att} = /att/pwck/
profile pwck /{,usr/}{,s}bin/pwck  flags=(attach_disconnected,attach_disconnected.path=@{att},complain) {
  include <abstractions/attached/base>
  include <abstractions/attached/consoles>
  include <abstractions/nameservice-strict>

  @{exec_path} mr,

  @{bin}/nscd rix,

  @{etc_ro}/login.defs r,

  /etc/.pwd.lock wk,
  /etc/passwd rw,
  /etc/passwd.@{int} rw,
  /etc/passwd.lock wl,
  /etc/shadow rw,
  /etc/shadow.@{int} rw,
  /etc/shadow.lock wl,

  /etc/machine-id r,

  include if exists <local/pwck>
}

# vim:syntax=apparmor
