Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Oct 2007 11:04:04 +0400
From:      "Artem Kuchin" <matrix@itlegion.ru>
To:        =?UTF-8?B?6Z+T5a625qiZIEJpbGwgSGFja2Vy?= <askbill@conducive.net>
Cc:        josh.carroll@gmail.com, Kostik Belousov <kostikbel@gmail.com>, freebsd-current@freebsd.org, Andrey Chernov <ache@nagual.pp.ru>
Subject:   Re: Broken su in current - trying to fix myself, help needed!
Message-ID:  <001c01c81155$1393ba00$0c00a8c0@Artem>
References:  <00bd01c810ec$10371230$0c00a8c0@Artem> <8cb6106e0710171143m3dff7546o457192ede76e6598@mail.gmail.com> <012c01c810f3$aafeecf0$0c00a8c0@Artem> <20071017194252.GL6511@deviant.kiev.zoral.com.ua> <007001c810fc$97cf3000$0c00a8c0@Artem> <471676A1.4030300@conducive.net>

next in thread | previous in thread | raw e-mail | index | archive | help
韓家標 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 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?001c01c81155$1393ba00$0c00a8c0>