[6338] in bugtraq

home help back first fref pref prev next nref lref last post

Re: Midnight Commander /tmp race

daemon@ATHENA.MIT.EDU (Pavel Kankovsky)
Wed Mar 18 15:38:22 1998

Date: 	Wed, 18 Mar 1998 11:27:46 +0100
Reply-To: peak@kerberos.troja.mff.cuni.cz
From: Pavel Kankovsky <peak@KERBEROS.TROJA.MFF.CUNI.CZ>
X-To:         willy@snowyowl.csu.ac.ru
To: BUGTRAQ@NETSPACE.ORG
In-Reply-To:  <Pine.LNX.3.96.980318100537.1780B-100000@snowyowl.csu.ac.ru>

On Wed, 18 Mar 1998 willy@snowyowl.csu.ac.ru wrote:

> > mc()
> > {
> >         MC=`/usr/bin/mc -P "$@"`
> >         [ -n "$MC" ] && cd $MC
> >         unset MC
> > }
>
> Nope.  This (rather old) version breaks Ctrl-O for nonroot bash
> instances.  However it works with Bourne shell.

It is the "suspend key" (ctrl-z by default) but I get the point.

bash 1.14.7, bash 2.00.0, and Solaris 2.5 ksh lock hard when the command
in `` (or $()) is suspended.

tcsh 6.06, Sol 2.5 csh, and Sol 2.5 jsh (sh + job control) disregard
ctrl+z when processing the command in ``.

Nevertheless, the function using a temporary file is not perfect either:
it allows the user to suspend mc but when as the process is stopped
the shell executes the rest of the function immediately (is it a bug or a
feature?) and the desired effect is lost.


--Pavel Kankovsky aka Peak   [ Boycott Microsoft -- http://www.vcnet.com/bms ]


P.S. There are probably many dark cornerns in the job control:
for instance, ``command1 && command2'' and ``command1 || command2''.

What should happen when command1 is suspended?

bash assumes command1 exits with code 0, csh seems to discard command2,
jsh does not allow to suspend command1.

home help back first fref pref prev next nref lref last post