zsh-users
 help / color / mirror / code / Atom feed
From: Nick Irvine <nfirvine@nfirvine.com>
To: zsh-users@zsh.org
Subject: compinit trusts .zcompdump even when it's owned by a different user?
Date: Wed, 06 Jan 2016 01:58:55 +0000	[thread overview]
Message-ID: <CAEiyHik4aCgcHhadAN_ApdpLBW=K_Dzez4mi4RgkLeE7psch3g@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1217 bytes --]

This may be a bug or misfeature in zsh, but I don't know it that well and I
may be misunderstanding.

compinit (the function that initializes completions) runs compaudit to
enforce a security model whereby it will only load completion functions
from directories in your $fpath that are considered "secure" (owned by root
or me, not world-writable, etc.). It will warn the user about insecure
paths and prompt to either skip them or abort. That's all well and good.

It creates a cache of the results at ~/.zcompdump. AFAICT, it is only
invalidated (i.e., deleted)*manually*.

I'm not entirely clear what's in the cache, so I can't say if this is
really a big security issue. But, at the very least, compinit will consider
the cache valid even if it's owned by a different user, thereby avoiding
loading completion functions that *are* valid for the current user but
*weren't* for the previous one.

This is happening to me every time I use sudo -s where my zsh installation
is owned by me (OS X homebrew). It writes an incomplete completion cache.
Then next shell I start, it loads the busted cache and doesn't see any
completions.

Is this my problem? ZSH's? Homebrew's?

(This is a cross-post from Stack Overflow.)

             reply	other threads:[~2016-01-06  1:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-06  1:58 Nick Irvine [this message]
2016-01-06  9:36 ` Peter Stephenson
2016-01-06 23:41   ` Nick Irvine

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAEiyHik4aCgcHhadAN_ApdpLBW=K_Dzez4mi4RgkLeE7psch3g@mail.gmail.com' \
    --to=nfirvine@nfirvine.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).