Broken su in current - trying to fix myself, help needed!
Artem Kuchin
matrix at itlegion.ru
Thu Oct 18 00:04:15 PDT 2007
韓家標 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
More information about the freebsd-current
mailing list