Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: What makes %# tick?



Peter Stephenson <pws@xxxxxxx> writes:

> Tim Haynes <zsh@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
> >  | zsh, sauce 12:15PM piglet/ # id
> >  | uid=1000(piglet) gid=1000(piglet)
> >  | groups=10(wheel),16(cron),18(audio),19(cdrom),250(portage),1000(piglet)
> >  | zsh, sauce 12:15PM piglet/ # 
> >                               ^oops.
> > 
> > I'm running zsh-4.2.5 on an amd64 box (gentoo linux) and am rather
> > attached to my %# prompt specifier.
> 
> The test of %# uses the function privasserted which is commented thus:
> 
> /* Check whether the shell is running with privileges in effect.  *
>  * This is the case if EITHER the euid is zero, OR (if the system *
>  * supports POSIX.1e (POSIX.6) capability sets) the process'      *
>  * Effective or Inheritable capability sets are non-empty.        */
> 
> I'm not sure what this feature gains in practice but it's possible your
> realtime module means that there is something in the capability sets and
> the shell therefore thinks that you are an enchanced lifeform.

:) Yes, I remember reading about capabilities in this stuff to do with
jackd. Sounds likely.

> There is a workaround. The shell allows you to test for a particular
> effective UID, and in this case there's no funny business about
> capability sets. You can make this otherwise mimic the behaviour of "%#"
> by replacing that with "%(#.#.%%)".

That works perfectly. Thank ye greatly!

Cheers,

~Tim
-- 
Ideologies come, ideologies go         |zsh@xxxxxxxxxxxxxxxxxxxxxxxxxx
A waste of words, and endless flow     |http://pig.sty.nu/Pictures/gallery/



Messages sorted by: Reverse Date, Date, Thread, Author