Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH 0/1] compaudit: add ZSH_COMPLETION_USERS parameter
- X-seq: zsh-workers 54881
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Petros Amoiridis <petros@xxxxxxxxxxxx>
- Cc: zsh-workers@xxxxxxx
- Subject: Re: [PATCH 0/1] compaudit: add ZSH_COMPLETION_USERS parameter
- Date: Tue, 30 Jun 2026 15:38:54 +0200
- Arc-authentication-results: i=1; mx.google.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=6ilaDdF8nCORB6foYcsQifAFeRm6QFk1Udn9Jh6kJMQ=; fh=EA0x6VnyGeNj78HANCyBqlwFau2XiIGVQIQfqZ9LXCc=; b=g117JtsuqHyT8vfSOZuz7DBwmdM8G+535c9eiKETxxq8gXc4lWpuzy5fbOQy5qBYR4 TGK3YCWG+TKh072VtDIjBC2p8F5q0CGNh9zA/T8ZRdISVHV6J2w4iE9Z6n9T7qMNjPya /NKbrIfwtrQ5kPkOuSIQeoERvFLY71b/St+8SmOhfYI7tgMICwlUixv3X95LcqrIkx8E /qzZ15abhTuBujmRHAgsAsma+ve4tcTnldlGeeFh4wOwOed4KQYlztBjkVmznTNkLveX vBdNMU5OAlQTfBv7a2mIy4ggZx7x0Zc9Yk0kTLPzrQWsU//t4+2MURv2xeZfVs8pINH9 65MQ==; darn=zsh.org
- Arc-seal: i=1; a=rsa-sha256; t=1782826748; cv=none; d=google.com; s=arc-20260327; b=foe5zVVAdxac+6gt/hKyXGu361yikcRI0kC5E/OyxNT7Ytw2Mn2VwCGeY5hzcV4UDO NOJOWigwKsbAeVrRcay+i1yVaM0DUzy0up9Oat1gBdYw2ylldrcAgxelGSsF2Su7BGKC xCQasluwldXYwgLu/EVBxH7uoo0n+SpAhj7peysHGC8ijfPlmAjd74sbHpyvONEKi2z9 Y09xS53t/EPEYU8Q54NARSfyjZ3j7Tsk1MEgHkYGD+C5k23xRTvZmrGsYl5GOBJpjMho dHsbJBXvFhgGvNcMZlkT8NWjkKUSLssFvUuGv13r6w3VWABIbMNpmAqhgYAN4XV4SJrB recQ==
- Archived-at: <https://zsh.org/workers/54881>
- In-reply-to: <20260630132020.75264-1-petros@workbrew.com>
- List-id: <zsh-workers.zsh.org>
- References: <20260630132020.75264-1-petros@workbrew.com>
On Tue, Jun 30, 2026 at 3:21 PM Petros Amoiridis <petros@xxxxxxxxxxxx> wrote:
>
> Hi,
>
> When a package manager installs zsh completions under a dedicated
> service account, compaudit rejects the files on every shell start,
> because the owner is neither root nor the current user and the
> existing trust list doesn't match. The usual workarounds (compinit
> -u, chowning the files, or dismissing the prompt each time) are all
> unsatisfying.
>
> Concrete cases I've run into:
>
> - Nix (nixbld* service accounts owning completions under
> /nix/store)
> - Workbrew (the 'workbrew' user owning Homebrew completions under
> /opt/homebrew)
> - Enterprise deployment tools using service accounts
>
> The attached patch adds a ZSH_COMPLETION_USERS parameter: a
> colon-delimited list of usernames or numeric UIDs appended to
> compaudit's trusted owners list. For example:
>
> export ZSH_COMPLETION_USERS="workbrew:nixbld"
Why export?
> Trust stays opt-in. The user (or system admin) has to name the
> additional trusted owner, and compaudit still rejects files that are
> world- or group-writable. The list can be per-user in ~/.zshenv or
> system-wide in /etc/zshenv.
Why would you set it in zshenv? Completions are not used in
noninteractive shells.
> There's already precedent in compaudit for trust beyond root and
> $EUID: it tries to trust the owner of the zsh executable, and there
> is a Debian-specific path for /usr/local under the 'staff' group.
> This patch generalizes those exceptions into a parameter users can
> configure.
>
> One implementation note: an earlier draft resolved usernames with
> 'getent passwd', which compaudit itself uses, but the getent shim
> compaudit defines for systems without it doesn't handle 'passwd'
> lookups on macOS. The patch uses 'id -u' instead, which works on
> Linux and macOS without a fallback.
"which compaudit itself uses" doesn't make sense, this is compaudit itself too.
> Happy to iterate on the name, documentation, or parsing. Patch
> follows.
Why can we trust $ZSH_COMPLETION_USERS from the environment if we
can't trust $fpath?
> Best regards,
> Petros Amoiridis
> petros@xxxxxxxxxxxx
>
> Petros Amoiridis (1):
> compaudit: add ZSH_COMPLETION_USERS parameter
>
> Completion/compaudit | 27 +++++++++++++++++++++++++++
> Doc/Zsh/params.yo | 14 ++++++++++++++
> 2 files changed, 41 insertions(+)
>
> --
> 2.55.0
>
>
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author