From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Tue, 17 May 2005 13:04:46 +0400 From: Alexey Tourbin To: ALT Linux Sisyphus discussion list Message-ID: <20050517090446.GR3554@solemn.turbinal.org> Mail-Followup-To: ALT Linux Sisyphus discussion list References: <20050429174842.GA8593@eugene-home.ikz.ru> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="6nfUOKxk8V1TQsEu" Content-Disposition: inline In-Reply-To: <20050429174842.GA8593@eugene-home.ikz.ru> Subject: [sisyphus] Re: zsh =?koi8-r?b?yQ==?= wks26 X-BeenThere: sisyphus@altlinux.ru X-Mailman-Version: 2.1.5 Precedence: list Reply-To: ALT Linux Sisyphus discussion list List-Id: ALT Linux Sisyphus discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2005 09:05:04 -0000 Archived-At: List-Archive: --6nfUOKxk8V1TQsEu Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 29, 2005 at 11:48:43PM +0600, Eugene Vlasov wrote: > eugene ~ # grep PROMPT .zshrc > PROMPT=3D'%n %4~ %(!.#.$) ' >=20 > =F2=C1=CE=D8=DB=C5 =D3 =D4=C1=CB=C9=CD=C9 =CE=C1=D3=D4=D2=CF=CA=CB=C1=CD= =C9 zsh =CF=D4=CF=C2=D2=C1=D6=C1=CC #, =C5=D3=CC=C9 =D2=C1=C2=CF=D4=C1=C5= =DB=D8 =C9=DA =D0=CF=C4 > root =C9 $ =D7 =D0=D2=CF=D4=C9=D7=CE=CF=CD =D3=CC=D5=DE=C1=C5. =E1 =D4=C5= =D0=C5=D2=D8 =D7=D3=C5 =D7=D2=C5=CD=D1 =D0=CF=CB=C1=DA=D9=D7=C1=C5=D4 #. ba= sh =D7=D3=C5 > =D0=CF=CB=C1=DA=D9=D7=C1=C5=D4 =CB=C1=CB =CE=C1=C4=CF. =ED=CF=D6=CE=CF = =CB=CF=CE=C5=DE=CE=CF =D0=CF=CD=C5=CE=D1=D4=D8 PROMPT, =CE=CF =C8=CF=D4=C5= =CC=CF=D3=D8 =C2=D9 > =D0=CF=CE=D1=D4=D8, =D7 =DE=C5=CD =CD=CF=D6=C5=D4 =C2=D9=D4=D8 =C4=C5=CC= =CF. $ info zsh 'Prompt Expansion' %# A `#' if the shell is running with privileges, a `%' if not. Equivalent to `%(!.#.%%)'. The definition 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. =F7 prompt.c =C9=D3=D0=CF=CC=D8=DA=D5=C5=D4=D3=D1 =C6=D5=CE=CB=C3=C9=D1 pri= vasserted(). $ zsh-4.2.5/Src $ sed -ne '/^privasserted/,/^}$/p' utils.c privasserted(void) { if(!geteuid()) return 1; #ifdef HAVE_CAP_GET_PROC { cap_t caps =3D cap_get_proc(); if(caps) { /* POSIX doesn't define a way to test whether a capability set * * is empty or not. Typical. I hope this is conforming... = */ cap_flag_value_t val; cap_value_t n; for(n =3D 0; !cap_get_flag(caps, n, CAP_EFFECTIVE, &val); n++) if(val) { cap_free(caps); return 1; } cap_free(caps); } } #endif /* HAVE_CAP_GET_PROC */ return 0; } $ =FE=D4=CF =CE=C5 =D4=C1=CB =D3 =DC=D4=C9=CD =CB=CF=C4=CF=CD? > --=20 > =F3 =D5=D7=C1=D6=C5=CE=C9=C5=CD, =E5=D7=C7=C5=CE=C9=CA = mailto:eugvv@altlinux.ru --6nfUOKxk8V1TQsEu Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQFCibOufBKgtDjnu0YRAheJAKDCxSHR7zBMpDNcT9ljY3yox9Ty/ACgq1GR R6E0qaJSo/zh7Bcrf3kjJe4= =JjuG -----END PGP SIGNATURE----- --6nfUOKxk8V1TQsEu--