[torquedev] Very suspicious code
David.Singleton at anu.edu.au
Mon Sep 6 05:52:50 MDT 2010
On 09/06/2010 09:41 PM, "Mgr. Šimon Tóth" wrote:
> I'm just hacking my way through some old code. I stumbled upon a very
> odd code. I'm not exactly sure if its a bug, but it definitely looks
> very odd and I'm pretty sure that it can lead to some very odd behaviour.
> The fork_to_user function does exactly what its name suggest, the weird
> thing is the error handling in req_cpyfile and req_delfile.
> req_cpyfile() reacts to all errors except PBSE_SYSTEM and PBSE_BADUSER
> with exit (thats ok, when the error is in child, exit should be called),
> all other are handled by a return, while req_delfile() reacts to all
> with return.
> Looking at the code of fork_to_user, what I think can happen is that
> there will be a hanging process when the PBSE_SYSTEM or PBSE_BADUSER is
> returned by the forked child (can happen), or when any error is returned
> by the forked child in req_delfile().
Is that this issue?
More information about the torquedev