From: Brian Candler Date: 2003-05-13T22:44:53+09:00 Subject: Re: RCR for child execution On Tue, May 13, 2003 at 06:50:54PM +0900, Simon Strandgaard wrote: > > In the general case, your Ruby program could do lots of things which force > > a direct output to stdout/stderr. Here is one small valid Ruby program: > > > > pid = fork do > > exec("ls /nonexistent") > > end > > Process.waitpid(pid) > > > > How are you going to modify Ruby so that the output of those four lines are > > captured in the sandbox? > > All "child-process" routines should parse rb_stdout to the children, in > this case fork. I know I have only mentioned system&backquote before. > Well all routines in Rubys Core which spawns children should do this. Not acceptable... this time I must insist that you answer the question :-) How exactly are you proposing to modify the Ruby interpreter so that the above four lines of Ruby code have their output captured? "fork" has specific, well-defined semantics: it just calls the underlying Unix fork. "exec" has specific, well-defined semantics in the same way. Neither of them involves pipes. What *exactly* do you want the two methods Kernel#fork and Kernel#exec to do instead of their currently defined behaviour? Regards, Brian.