ALT Linux Sisyphus discussions
 help / color / mirror / Atom feed
* [sisyphus] zsh и wks26
@ 2005-04-29 17:48 Eugene Vlasov
  2005-04-29 18:31 ` [sisyphus] " Konstantin A. Lepikhov
  2005-05-17  9:04 ` Alexey Tourbin
  0 siblings, 2 replies; 10+ messages in thread
From: Eugene Vlasov @ 2005-04-29 17:48 UTC (permalink / raw)
  To: ALT Linux Sisyphus discussion list

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

Добрый день.

Решил попробовать wks26 и заметил странную вещь: после загрузки
commoncap и realtime zsh начинает считать меня root'ом (во всяком
случае у него меняется подсказка).

eugene ~ # uname -r
2.6.11-wks26-up-alt2

eugene ~ # id
uid=501(eugene) gid=501(eugene) группы=10(wheel),14(uucp),19(proc),80(cdwriter),81(audio),108(dba),117(wine),131(hashman),501(eugene)

eugene ~ # grep PROMPT .zshrc
PROMPT='%n %4~ %(!.#.$) '

Раньше с такими настройками zsh отображал #, если работаешь из под
root и $ в противном случае. А теперь все время показывает #. bash все
показывает как надо. Можно конечно поменять PROMPT, но хотелось бы
понять, в чем может быть дело.


-- 
С уважением, Евгений                          mailto:eugvv@altlinux.ru


[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [sisyphus] Re: zsh и wks26
  2005-04-29 17:48 [sisyphus] zsh и wks26 Eugene Vlasov
@ 2005-04-29 18:31 ` Konstantin A. Lepikhov
  2005-05-17  9:04 ` Alexey Tourbin
  1 sibling, 0 replies; 10+ messages in thread
From: Konstantin A. Lepikhov @ 2005-04-29 18:31 UTC (permalink / raw)
  To: ALT Linux Sisyphus discussion list

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

Hi Eugene!

Friday 29, at 11:48:43 PM you wrote:

<skip>
> Раньше с такими настройками zsh отображал #, если работаешь из под
> root и $ в противном случае. А теперь все время показывает #. bash все
> показывает как надо. Можно конечно поменять PROMPT, но хотелось бы
> понять, в чем может быть дело.
все-таки это проблемы zsh :)

-- 
WBR, Konstantin	      chat with ==>ICQ: 109916175
     Lepikhov,	      speak  to ==>JID: lakostis@jabber.org
aka L.A. Kostis       write  to ==>mailto:lakostis@pisem.net.nospam

...The information is like the bank... 			  (c) EC8OR

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [sisyphus] Re: zsh и wks26
  2005-04-29 17:48 [sisyphus] zsh и wks26 Eugene Vlasov
  2005-04-29 18:31 ` [sisyphus] " Konstantin A. Lepikhov
@ 2005-05-17  9:04 ` Alexey Tourbin
  2005-05-17 10:44   ` Dmitry V. Levin
  1 sibling, 1 reply; 10+ messages in thread
From: Alexey Tourbin @ 2005-05-17  9:04 UTC (permalink / raw)
  To: ALT Linux Sisyphus discussion list

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

On Fri, Apr 29, 2005 at 11:48:43PM +0600, Eugene Vlasov wrote:
> eugene ~ # grep PROMPT .zshrc
> PROMPT='%n %4~ %(!.#.$) '
> 
> Раньше с такими настройками zsh отображал #, если работаешь из под
> root и $ в противном случае. А теперь все время показывает #. bash все
> показывает как надо. Можно конечно поменять PROMPT, но хотелось бы
> понять, в чем может быть дело.

$ 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.

В prompt.c используется функция privasserted().

$ 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 = 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 = 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;
}
$

Что не так с этим кодом?

> -- 
> С уважением, Евгений                          mailto:eugvv@altlinux.ru

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [sisyphus] Re: zsh и wks26
  2005-05-17  9:04 ` Alexey Tourbin
@ 2005-05-17 10:44   ` Dmitry V. Levin
  2005-05-17 10:56     ` Alexey Rusakov
  0 siblings, 1 reply; 10+ messages in thread
From: Dmitry V. Levin @ 2005-05-17 10:44 UTC (permalink / raw)
  To: ALT Linux Sisyphus discussion list

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

On Tue, May 17, 2005 at 01:04:46PM +0400, Alexey Tourbin wrote:
> On Fri, Apr 29, 2005 at 11:48:43PM +0600, Eugene Vlasov wrote:
> > eugene ~ # grep PROMPT .zshrc
> > PROMPT='%n %4~ %(!.#.$) '
> > 
> > Раньше с такими настройками zsh отображал #, если работаешь из под
> > root и $ в противном случае. А теперь все время показывает #. bash все
> > показывает как надо. Можно конечно поменять PROMPT, но хотелось бы
> > понять, в чем может быть дело.
> 
> $ 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.
> 
> В prompt.c используется функция privasserted().

Наверное, в wks26 все процессы привилегированные.


-- 
ldv

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [sisyphus] Re: zsh и wks26
  2005-05-17 10:44   ` Dmitry V. Levin
@ 2005-05-17 10:56     ` Alexey Rusakov
  2005-05-17 11:15       ` Alex Yustasov
  2005-05-17 14:15       ` Alexey Tourbin
  0 siblings, 2 replies; 10+ messages in thread
From: Alexey Rusakov @ 2005-05-17 10:56 UTC (permalink / raw)
  To: ALT Linux Sisyphus discussion list

Dmitry V. Levin wrote:

>On Tue, May 17, 2005 at 01:04:46PM +0400, Alexey Tourbin wrote:
>  
>
>>On Fri, Apr 29, 2005 at 11:48:43PM +0600, Eugene Vlasov wrote:
>>    
>>
>>>eugene ~ # grep PROMPT .zshrc
>>>PROMPT='%n %4~ %(!.#.$) '
>>>
>>>Раньше с такими настройками zsh отображал #, если работаешь из под
>>>root и $ в противном случае. А теперь все время показывает #. bash все
>>>показывает как надо. Можно конечно поменять PROMPT, но хотелось бы
>>>понять, в чем может быть дело.
>>>      
>>>
>>$ 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.
>>
>>В prompt.c используется функция privasserted().
>>    
>>
>
>Наверное, в wks26 все процессы привилегированные.
>  
>
:)
У меня указанный промпт на wks26 работает так, как нужно.

-- 
  Alexey "Ktirf" Rusakov


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [sisyphus] Re: zsh и wks26
  2005-05-17 10:56     ` Alexey Rusakov
@ 2005-05-17 11:15       ` Alex Yustasov
  2005-05-17 14:48         ` Alex Yustasov
  2005-05-17 14:15       ` Alexey Tourbin
  1 sibling, 1 reply; 10+ messages in thread
From: Alex Yustasov @ 2005-05-17 11:15 UTC (permalink / raw)
  To: sisyphus

On Tue, May 17, 2005 at 02:56:25PM +0400, Alexey Rusakov wrote:
> >>>eugene ~ # grep PROMPT .zshrc
> >>>PROMPT='%n %4~ %(!.#.$) '
> >>>
> >>>Раньше с такими настройками zsh отображал #, если работаешь из под
> >>>root и $ в противном случае. А теперь все время показывает #. bash все

skip

> :)
> У меня указанный промпт на wks26 работает так, как нужно.

И у меня.
[alex@mc alex]$ zsh
alex ~ $ su -l
Password: 
[root@mc root]# zsh
root@mc ~ #



^ permalink raw reply	[flat|nested] 10+ messages in thread

* [sisyphus] Re: zsh и wks26
  2005-05-17 10:56     ` Alexey Rusakov
  2005-05-17 11:15       ` Alex Yustasov
@ 2005-05-17 14:15       ` Alexey Tourbin
  2005-05-17 15:03         ` Alexey Rusakov
  2005-05-18 20:44         ` Konstantin A. Lepikhov
  1 sibling, 2 replies; 10+ messages in thread
From: Alexey Tourbin @ 2005-05-17 14:15 UTC (permalink / raw)
  To: ALT Linux Sisyphus discussion list

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

On Tue, May 17, 2005 at 02:56:25PM +0400, Alexey Rusakov wrote:
> >Наверное, в wks26 все процессы привилегированные.
> У меня указанный промпт на wks26 работает так, как нужно.

В оригинале -- "после загрузки commoncap и realtime".

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [sisyphus] Re: zsh и wks26
  2005-05-17 11:15       ` Alex Yustasov
@ 2005-05-17 14:48         ` Alex Yustasov
  0 siblings, 0 replies; 10+ messages in thread
From: Alex Yustasov @ 2005-05-17 14:48 UTC (permalink / raw)
  To: sisyphus

On Tue, May 17, 2005 at 02:15:51PM +0300, Alex Yustasov wrote:
> И у меня.
> [alex@mc alex]$ zsh
> alex ~ $ su -l
> Password: 
> [root@mc root]# zsh
> root@mc ~ #
Это было с modprobe realtime.
На другой машине с modprobe realtime any=1 
картина другая, т.е. неправильная, везде $.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [sisyphus] Re: zsh и wks26
  2005-05-17 14:15       ` Alexey Tourbin
@ 2005-05-17 15:03         ` Alexey Rusakov
  2005-05-18 20:44         ` Konstantin A. Lepikhov
  1 sibling, 0 replies; 10+ messages in thread
From: Alexey Rusakov @ 2005-05-17 15:03 UTC (permalink / raw)
  To: ALT Linux Sisyphus discussion list

Alexey Tourbin wrote:

>On Tue, May 17, 2005 at 02:56:25PM +0400, Alexey Rusakov wrote:
>  
>
>>>Наверное, в wks26 все процессы привилегированные.
>>>      
>>>
>>У меня указанный промпт на wks26 работает так, как нужно.
>>    
>>
>В оригинале -- "после загрузки commoncap и realtime".
>  
>
Сорри, не отметил. У меня только capability...

-- 
  Alexey "Ktirf" Rusakov


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [sisyphus] Re: zsh и wks26
  2005-05-17 14:15       ` Alexey Tourbin
  2005-05-17 15:03         ` Alexey Rusakov
@ 2005-05-18 20:44         ` Konstantin A. Lepikhov
  1 sibling, 0 replies; 10+ messages in thread
From: Konstantin A. Lepikhov @ 2005-05-18 20:44 UTC (permalink / raw)
  To: ALT Linux Sisyphus discussion list

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

Hi Alexey!

Tuesday 17, at 06:15:11 PM you wrote:

> On Tue, May 17, 2005 at 02:56:25PM +0400, Alexey Rusakov wrote:
> > >Наверное, в wks26 все процессы привилегированные.
> > У меня указанный промпт на wks26 работает так, как нужно.
> 
> В оригинале -- "после загрузки commoncap и realtime".
значит, автор сообщения умолчал, что он воспользовался any=1

из realtime-lsm.txt:

# modprobe realtime any=1

Any program can request realtime privileges.  This allows any local
user to crash the system by hogging the CPU in a tight loop or
locking down too much memory.  But, it is simple to administer.  :-)

-- 
WBR, Konstantin	      chat with ==>ICQ: 109916175
     Lepikhov,	      speak  to ==>JID: lakostis@jabber.org
aka L.A. Kostis       write  to ==>mailto:lakostis@pisem.net.nospam

...The information is like the bank... 			  (c) EC8OR

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2005-05-18 20:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-29 17:48 [sisyphus] zsh и wks26 Eugene Vlasov
2005-04-29 18:31 ` [sisyphus] " Konstantin A. Lepikhov
2005-05-17  9:04 ` Alexey Tourbin
2005-05-17 10:44   ` Dmitry V. Levin
2005-05-17 10:56     ` Alexey Rusakov
2005-05-17 11:15       ` Alex Yustasov
2005-05-17 14:48         ` Alex Yustasov
2005-05-17 14:15       ` Alexey Tourbin
2005-05-17 15:03         ` Alexey Rusakov
2005-05-18 20:44         ` Konstantin A. Lepikhov

ALT Linux Sisyphus discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/sisyphus/0 sisyphus/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 sisyphus sisyphus/ http://lore.altlinux.org/sisyphus \
		sisyphus@altlinux.ru sisyphus@altlinux.org sisyphus@lists.altlinux.org sisyphus@lists.altlinux.ru sisyphus@lists.altlinux.com sisyphus@linuxteam.iplabs.ru sisyphus@list.linux-os.ru
	public-inbox-index sisyphus

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.sisyphus


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git