Re: Broken su in current - trying to fix myself, help needed!

From: Artem Kuchin <matrix_at_itlegion.ru>
Date: Thu, 18 Oct 2007 11:04:04 +0400
韓家標 Bill Hacker wrote:
> Artem Kuchin wrote:
>>> Ah, mc.
>>> Ok, it is reproducable in the following way:
>>> pooma% sh
>>> +m                                                                 ~ $ ~/work/scratch/su.pl
>>> Password:
>>> heck
>>> done!
>>> $ [1]  + 1725 suspended (tty input)  sh +m
>>> pooma%
>>>
>>> Note the +m, that turns off the job control.
>>
>> I switched from csh (which is tcsh)
>
> Mmy PowerBook and my Beastie boxen don't *quite* agree on that point,
> but 'close enough' ordinarily...
>
>  to sh and run
>> the script from midnight commander.
>> I got:
>>
>> heck
>> done!
>> Press any key to continue...[1] + Stopped (tty output)    mc
>>
>> So, script finished and midnight commander get suspended now.
>>
>
> Not exactly what I *suspected* would be found when I asked if we were
> chasing the right animal --- but not an su or tsch issue, either.
>
> What happens if you play with '&' '&&' 'exit' or even just a
> <newline> in the script at the right places?

still using /bin/sh as shell

script is called a.pl

1) exit at the end of the script does not change anything
2) ./a.pl && does not change  anything
3) ./a.pl & alsmost the same except thart order  changes a bit
# ./a.pl &
Press any key to continue...heck
                                done!

'Press any key to continues' comes from mc

4)
if i chane the script
$com="/usr/bin/su root -c 'echo heck' &";
(note & is related to shell in su,  not to echo)

# ./a.pl
done!
Press any key to continue...heck
                                [1] + Stopped (tty input)     mc
                                                                #

After heck it wait or ENTER to be pressed. This is interesting, because
it means control is returned to mc and it wait for the key, but after i press
ENTER i get stopped.

5)
$com="/usr/bin/su root -c 'echo heck' &&";

does not change anything

6) & and && in echo like
'echo heck &' do no change anything


--
Artem 
Received on Thu Oct 18 2007 - 05:04:15 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:19 UTC