linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: Strange behavior observed w.r.t 'su' command
@ 2003-11-28  9:39 Bradley Chapman
  2003-11-28  9:54 ` Måns Rullgård
  2003-11-28  9:59 ` Raj
  0 siblings, 2 replies; 14+ messages in thread
From: Bradley Chapman @ 2003-11-28  9:39 UTC (permalink / raw)
  To: Mans Rullgard; +Cc: linux-kernel

Mr. Rullgard,

Confirmed. I have a Red Hat 9 system running 2.6.0-test11 with glibc 2.3.2-82
and coreutils 4.5.3-19.0.2. Killing su with SIGKILL does put the keyboard into
unbuffered mode and does alternate the prompts. No error messages appear in dmesg.

Brad

=====


__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

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

* Re: Strange behavior observed w.r.t 'su' command
  2003-11-28  9:39 Strange behavior observed w.r.t 'su' command Bradley Chapman
@ 2003-11-28  9:54 ` Måns Rullgård
  2003-11-28  9:59 ` Raj
  1 sibling, 0 replies; 14+ messages in thread
From: Måns Rullgård @ 2003-11-28  9:54 UTC (permalink / raw)
  To: linux-kernel

Bradley Chapman <kakadu_croc@yahoo.com> writes:

> Confirmed. I have a Red Hat 9 system running 2.6.0-test11 with glibc
> 2.3.2-82 and coreutils 4.5.3-19.0.2. Killing su with SIGKILL does
> put the keyboard into unbuffered mode and does alternate the
> prompts. No error messages appear in dmesg.

Does anyone know why redhat keeps doing these strange modifications?
Over the years, I've encountered quite a few problems caused by redhat
messing things up.  A few examples:

- gcc 2.96
- A rather recent redhat version shipped with a broken 'sort'
  command.  It performed a seemingly random permutation.
- Redhat 9 perl doesn't treat rexexps the same way a clean perl of the
  same version does.

Anyway, I guess it could be over soon, if only people would understand
to stay away from that fedora stuff.

-- 
Måns Rullgård
mru@kth.se


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

* Re: Strange behavior observed w.r.t 'su' command
  2003-11-28  9:39 Strange behavior observed w.r.t 'su' command Bradley Chapman
  2003-11-28  9:54 ` Måns Rullgård
@ 2003-11-28  9:59 ` Raj
  1 sibling, 0 replies; 14+ messages in thread
From: Raj @ 2003-11-28  9:59 UTC (permalink / raw)
  To: linux-kernel

One more observation:

This time i wrote two shell functions, one for the user and another for 
root. I placed them in the .bash_profile

for root
z()
{
    touch /tmp/createdbyroot
}

for user
z()
{
    touch /tmp/createdbyuser
}

I then reproduced the problem, and during the alternation of the 
prompts, when i was on the user prompt, i ran 'whoami' and it showed me 
as a normal user. Then i ran 'z'. I expected the filename in /tmp to be 
'createdbyuser' but it is actually 'createdbyroot' !!!

/Raj


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

* Re: Strange behavior observed w.r.t 'su' command
  2003-11-28 11:11       ` Måns Rullgård
@ 2003-11-28 11:56         ` Andreas Schwab
  0 siblings, 0 replies; 14+ messages in thread
From: Andreas Schwab @ 2003-11-28 11:56 UTC (permalink / raw)
  To: Måns Rullgård; +Cc: linux-kernel

mru@kth.se (Måns Rullgård) writes:

> Andreas Schwab <schwab@suse.de> writes:
>
>>> It appears that my su exec()s the shell, whereas the redhat and gentoo
>>> su fork() and exec().
>>
>> Yes, your su probably does not support PAM.
>
> I don't think it does.  I still don't see the need to fork when using
> PAM.

Because PAM needs to do some cleanup after the shell has exited.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* Re: Strange behavior observed w.r.t 'su' command
  2003-11-28 11:22       ` Raj
@ 2003-11-28 11:52         ` Andreas Schwab
  0 siblings, 0 replies; 14+ messages in thread
From: Andreas Schwab @ 2003-11-28 11:52 UTC (permalink / raw)
  To: Raj; +Cc: Måns Rullgård, linux-kernel

Raj <raju@mailandnews.com> writes:

> But why is it that after 'su - root', running 'ps' shows 'su' as a
> separate process, whereas, 'su - otheruser' and then 'ps' does not show
> su' in the process list ??

Because you didn't list all processes.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* Re: Strange behavior observed w.r.t 'su' command
  2003-11-28 10:53     ` Andreas Schwab
  2003-11-28 11:11       ` Måns Rullgård
@ 2003-11-28 11:22       ` Raj
  2003-11-28 11:52         ` Andreas Schwab
  1 sibling, 1 reply; 14+ messages in thread
From: Raj @ 2003-11-28 11:22 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Måns Rullgård, linux-kernel

Andreas Schwab wrote:

>mru@kth.se (Måns Rullgård) writes:
>
>  
>
>>It appears that my su exec()s the shell, whereas the redhat and gentoo
>>su fork() and exec().
>>    
>>
>
>Yes, your su probably does not support PAM.
>
>Andreas.
>
>  
>
But why is it that after 'su - root', running 'ps' shows 'su' as a 
separate process, whereas, 'su - otheruser' and then 'ps' does not show 
'su' in the process list ??
In plain words, why does this happen only for su to root ?

/Raj



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

* Re: Strange behavior observed w.r.t 'su' command
  2003-11-28 10:53     ` Andreas Schwab
@ 2003-11-28 11:11       ` Måns Rullgård
  2003-11-28 11:56         ` Andreas Schwab
  2003-11-28 11:22       ` Raj
  1 sibling, 1 reply; 14+ messages in thread
From: Måns Rullgård @ 2003-11-28 11:11 UTC (permalink / raw)
  To: linux-kernel

Andreas Schwab <schwab@suse.de> writes:

>> It appears that my su exec()s the shell, whereas the redhat and gentoo
>> su fork() and exec().
>
> Yes, your su probably does not support PAM.

I don't think it does.  I still don't see the need to fork when using
PAM.

-- 
Måns Rullgård
mru@kth.se


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

* Re: Strange behavior observed w.r.t 'su' command
  2003-11-28  9:15 ` Måns Rullgård
@ 2003-11-28 10:57   ` Tim Cambrant
  2003-11-28 10:54     ` Andre Tomt
  0 siblings, 1 reply; 14+ messages in thread
From: Tim Cambrant @ 2003-11-28 10:57 UTC (permalink / raw)
  To: mru; +Cc: Linux Kernel Mailing List

On Fri, Nov 28, 2003 at 10:15:50AM +0100, M?ns Rullg?rd wrote:
> I can't reproduce it on Slackware running 2.6.0-test10.  It's probably
> a redhat thing.

This problem also appears on Gentoo 1.4 running 2.6.0-test11. I don't
know about the rest of the environment, but it's definately not just
a RedHat thing. Could it have something to do with some library-version
or something?

-- 
Tim Cambrant <tim@cambrant.com> 
GPG KeyID 0x59518702
Fingerprint: 14FE 03AE C2D1 072A 87D0  BC4D FA9E 02D8 5951 8702

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

* Re: Strange behavior observed w.r.t 'su' command
  2003-11-28 10:57   ` Tim Cambrant
@ 2003-11-28 10:54     ` Andre Tomt
  0 siblings, 0 replies; 14+ messages in thread
From: Andre Tomt @ 2003-11-28 10:54 UTC (permalink / raw)
  To: Linux Kernel Mailing List

On Fri, 2003-11-28 at 11:57, Tim Cambrant wrote:
> On Fri, Nov 28, 2003 at 10:15:50AM +0100, M?ns Rullg?rd wrote:
> > I can't reproduce it on Slackware running 2.6.0-test10.  It's probably
> > a redhat thing.
> 
> This problem also appears on Gentoo 1.4 running 2.6.0-test11. I don't
> know about the rest of the environment, but it's definately not just
> a RedHat thing. Could it have something to do with some library-version
> or something?

For whatever it's worth, I can't reproduce this on a Debian Sid system
with kernel version 2.4.23-rc1. I guess RH/Gentoo isn't killing off the
forked shell when su dies brutally, leaving the root shell and the user
shell fighting for the terminal.



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

* Re: Strange behavior observed w.r.t 'su' command
  2003-11-28 10:47   ` Måns Rullgård
@ 2003-11-28 10:53     ` Andreas Schwab
  2003-11-28 11:11       ` Måns Rullgård
  2003-11-28 11:22       ` Raj
  0 siblings, 2 replies; 14+ messages in thread
From: Andreas Schwab @ 2003-11-28 10:53 UTC (permalink / raw)
  To: Måns Rullgård; +Cc: linux-kernel

mru@kth.se (Måns Rullgård) writes:

> It appears that my su exec()s the shell, whereas the redhat and gentoo
> su fork() and exec().

Yes, your su probably does not support PAM.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* Re: Strange behavior observed w.r.t 'su' command
  2003-11-28 10:33 ` Andreas Schwab
@ 2003-11-28 10:47   ` Måns Rullgård
  2003-11-28 10:53     ` Andreas Schwab
  0 siblings, 1 reply; 14+ messages in thread
From: Måns Rullgård @ 2003-11-28 10:47 UTC (permalink / raw)
  To: linux-kernel

Andreas Schwab <schwab@suse.de> writes:

>> hi, i am not sure if this is a kernel problem or an 'su' related issue,
>> but this is what  i have observed. Tried on 2.4.20-8 ( RH 9.0 kernel ) and
>> latest 2.6.0-test11.
>>
>> - log in as any normal user. ( on Console.).
>> - su - root
>> - from root prompt, run 'ps' and check the pid of 'su'.
>> - kill -9 <pid of su>
>> After the kill command, strangely my keyboard switches to unbuffered mode
>> ( a key press is processed immediately ). Also, i alternate between the
>> root prompt and the normal user prompt.
>> Every key press switches from root prompt to normal user prompt and vice
>> versa. Typing 'whoami' at the respective prompts displays 'normal user'
>> and 'root' for the respective prompts.
>
> Nothing unusual, you just have two shells competing with each other on the
> terminal.  Don't use kill -9 unless you know what you are doing.

It appears that my su exec()s the shell, whereas the redhat and gentoo
su fork() and exec().

-- 
Måns Rullgård
mru@kth.se


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

* Re: Strange behavior observed w.r.t 'su' command
  2003-11-28  8:30 Raj
  2003-11-28  9:15 ` Måns Rullgård
@ 2003-11-28 10:33 ` Andreas Schwab
  2003-11-28 10:47   ` Måns Rullgård
  1 sibling, 1 reply; 14+ messages in thread
From: Andreas Schwab @ 2003-11-28 10:33 UTC (permalink / raw)
  To: Raj; +Cc: linux-kernel

Raj <raju@mailandnews.com> writes:

> hi, i am not sure if this is a kernel problem or an 'su' related issue,
> but this is what  i have observed. Tried on 2.4.20-8 ( RH 9.0 kernel ) and
> latest 2.6.0-test11.
>
> - log in as any normal user. ( on Console.).
> - su - root
> - from root prompt, run 'ps' and check the pid of 'su'.
> - kill -9 <pid of su>
> After the kill command, strangely my keyboard switches to unbuffered mode
> ( a key press is processed immediately ). Also, i alternate between the
> root prompt and the normal user prompt.
> Every key press switches from root prompt to normal user prompt and vice
> versa. Typing 'whoami' at the respective prompts displays 'normal user'
> and 'root' for the respective prompts.

Nothing unusual, you just have two shells competing with each other on the
terminal.  Don't use kill -9 unless you know what you are doing.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* Re: Strange behavior observed w.r.t 'su' command
  2003-11-28  8:30 Raj
@ 2003-11-28  9:15 ` Måns Rullgård
  2003-11-28 10:57   ` Tim Cambrant
  2003-11-28 10:33 ` Andreas Schwab
  1 sibling, 1 reply; 14+ messages in thread
From: Måns Rullgård @ 2003-11-28  9:15 UTC (permalink / raw)
  To: linux-kernel

Raj <raju@mailandnews.com> writes:

> hi, i am not sure if this is a kernel problem or an 'su' related
> issue, but this is what  i have observed. Tried on 2.4.20-8 ( RH 9.0
> kernel ) and latest 2.6.0-test11.
>
> - log in as any normal user. ( on Console.).
> - su - root
> - from root prompt, run 'ps' and check the pid of 'su'.
> - kill -9 <pid of su>
> After the kill command, strangely my keyboard switches to unbuffered
> mode ( a key press is processed immediately ). Also, i alternate
> between the root prompt and the normal user prompt.
> Every key press switches from root prompt to normal user prompt and
> vice versa. Typing 'whoami' at the respective prompts displays 'normal
> user' and 'root' for the respective prompts.

I can't reproduce it on Slackware running 2.6.0-test10.  It's probably
a redhat thing.

-- 
Måns Rullgård
mru@kth.se


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

* Strange behavior observed w.r.t 'su' command
@ 2003-11-28  8:30 Raj
  2003-11-28  9:15 ` Måns Rullgård
  2003-11-28 10:33 ` Andreas Schwab
  0 siblings, 2 replies; 14+ messages in thread
From: Raj @ 2003-11-28  8:30 UTC (permalink / raw)
  To: linux-kernel

hi, i am not sure if this is a kernel problem or an 'su' related issue, 
but this is what  i have observed. Tried on 2.4.20-8 ( RH 9.0 kernel ) 
and latest 2.6.0-test11.

- log in as any normal user. ( on Console.).
- su - root
- from root prompt, run 'ps' and check the pid of 'su'.
- kill -9 <pid of su>
After the kill command, strangely my keyboard switches to unbuffered 
mode ( a key press is processed immediately ). Also, i alternate between 
the root prompt and the normal user prompt.
Every key press switches from root prompt to normal user prompt and vice 
versa. Typing 'whoami' at the respective prompts displays 'normal user' 
and 'root' for the respective prompts.

What could be wrong ? Or am i doing something which i shouldnt be doing ?

/Raj



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

end of thread, other threads:[~2003-11-28 11:59 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-28  9:39 Strange behavior observed w.r.t 'su' command Bradley Chapman
2003-11-28  9:54 ` Måns Rullgård
2003-11-28  9:59 ` Raj
  -- strict thread matches above, loose matches on Subject: below --
2003-11-28  8:30 Raj
2003-11-28  9:15 ` Måns Rullgård
2003-11-28 10:57   ` Tim Cambrant
2003-11-28 10:54     ` Andre Tomt
2003-11-28 10:33 ` Andreas Schwab
2003-11-28 10:47   ` Måns Rullgård
2003-11-28 10:53     ` Andreas Schwab
2003-11-28 11:11       ` Måns Rullgård
2003-11-28 11:56         ` Andreas Schwab
2003-11-28 11:22       ` Raj
2003-11-28 11:52         ` Andreas Schwab

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