Re: [tcljava-user] stdout / stdin
Brought to you by:
mdejong
From: Mo D. <mo...@mo...> - 2007-05-04 19:51:41
|
Justin Ryan wrote: > Before using Jacl, I was executing a Tcl binary via Runtime.exec. This > provided me with an easy way of grabbing the input/output from the > Process variable. My requirement is to capture the stdout of a > untrusted Tcl script (and not the result). > > I'd like to see Jacl behave like its in a sandbox, to use in a JSR-233 > fashion. In which it minimizes it's access to the System class > (System.exit, System.out, System.err). Are there any efforts in this > regard? > > justin > > Hi Justin The approach of overwriting puts, gets, and read is not too complex and should work for you. But, it would be a lot easier to modify the tcl.lang.StdChannel class to support setting the STDIN, STDOUT, AND STDERR streams to a user supplied stream. This is likely a 30 minute hack, I am sure you could implement it easily. If you want to do that and post a patch, I can add it to the CVS version for Jacl 1.4. cheers Mo DeJong |