On 4/24/06, Axel Liljencrantz <[EMAIL PROTECTED]> wrote:
> On 4/23/06, Philip Ganchev <[EMAIL PROTECTED]> wrote:
[...]
> > Fish 1.21.6 seems to freeze only if I try to return to job n when
> > there is no job n:
> >
> > fish> jobs
> > Job     Group   CPU     State   Command
> > 0       28475   0%      stopped man man
> > 1       28666   0%      stopped less hello.txt
> > fish> fg %2
> > Send job 2, 'fg %2' to foreground
> > fish: Could not send job 2 ('fg %2') to foreground
> > tcsetpgrp: Operation not permitted
> >
> > [Fish freezes.]
>
> Oopsie. I can reproduce this. Will look into it.

Two bugs working in tandem:

* Since there is no job with job id 2, the whole string '%2' is sent
to fg. So far, so good. fg uses wcstol to convert this string to a
digit and forgets to check that the entire string is a valid number.
Hence, the first zero characters are converted to the number 0, e.g.
group id is found to be 0.
* Job 0 actually exists - it is 'fg' itself - all jobs get the
temporary group id 0 before any process in the job actually forks.
When run without parameters, 'fg' makes sure that only  jobs that have
been properly constructed are considered, but this check was not done
when the job id is specified.

The result: 'fg' tries to put itself into the foreground.

[...]

--
Axel


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Fish-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to