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

prompt expansion and POSIX.1e capabilities



I know nothing about these things.

----- Forwarded message from Galen Hancock <galen@xxxxxxxxxxxxxxxxx> -----

Package: zsh
Version: 4.0.0+4.0.1.pre4-3

The default PS1 is "%m%# ". zsh conforms to the part of its man page,
under PROMPT EXPANSION, which says:

       %#     A  `#'  if  the shell is running with privileges, a
              `%' if not.  Equivalent to `%(!.#.%%)'.  The  defi­
              nition of `privileged', for these purposes, is that
              either the  effective  user  ID  is  zero,  or,  if
              POSIX.1e  capabilities are supported, that at least
              one capability is raised in either the Effective or
              Inheritable capability vectors.

This is not useful behavior, because (at least on my installation),
normal users have all capabilities but cap_setpcap raised inheritable.
This gives me a # prompt, not %, when I log in.

soda% ssh gh.dhs.org
[... normal user logon]
windriver# zsh --version
zsh 4.0.1-pre-4+debian0515 (i686-pc-linux-gnu)
windriver# zmodload zsh/cap
windriver# id
uid=1000(galen) gid=1000(galen) groups=1000(galen),24(cdrom),25(floppy),29(audio),33(www-data),37(operator),40(src),44(video),50(staff),60(games),101(dba),500(wheel),2000(mp3)
windriver# cap
=i cap_setpcap-i
windriver# cap =
windriver% cap
=
windriver% uname -sr
Linux 2.2.15

The format in which capabilites are printed is documented in
cap_from_text(3). = means no capabilites raised, and "=i cap_setpcap-i"
means, first, all capabilities raised in inheritable and, then,
cap_setpcap turned off in inheritable.

I don't know much about capabilites, so I don't know for sure what a more
reasonable setting would be; I think "at least one capability raised in
'effective'" would make sense.

					Galen



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