Re: Eclipse query

From: Kevin <cf286_at_city.ac.uk>
Date: Fri 12 Apr 2002 12:38:54 AM GMT
Message-ID: <Pine.GSO.4.21.0204120131290.6092-100000@swindon>
Hi,

You may recall the email I sent last month where I was trying to execute
eclipse code within a web browser...

Basically, I needed to be able to enter code onto a browser, execute it,
and return a result back onto the browser.

Joachim emailled me a few files;
run.html
run.pl
and eclipse.cgi.

However, when I run run.html and click on "complile and run", my browser
will only display the contents of eclipse.cgi as text on the screen. i.e,
it wont "actually" execute any code.!

eclipse.cgi contains an execution statment that presumably is to run on a
server at icparc. (I think), which then takes and runs the contents of
run.pl.

But eclipse.cgi wont execute....!

Can you please tell me why??????



On Mon, 11 Mar 2002, Joachim Schimpf wrote:

> Kevin wrote:
> > 
> > Is it possible to "launch" eclipse code wia the web... I.e User enters his
> > info into text fields and clicks submit, is it then possible to initiates
> > eclipse code and
> > returns an answer/output onto the browser for the user to view???
> 
> 
> I attach some code that uses the cgi interface of an
> http server to call Eclipse:
> 
> run.html is an html page that lets you input code and a query.
> When you click the submit-button, your http server should
> launch eclipse.cgi (provided you have put eclipse.cgi in the
> right place and set all the permissions correctly).
> 
> eclipse.cgi is a sh-script that lauches eclipse, which then
> loads run.pl and exexcutes go/0.
> 
> go/0 uses predicates from lib(cgi) to get the user input
> from the web form, and processes this data. It then writes
> an html page to standard output, which should then appear
> on your browser.
> 
> 
> Note that the attached example code is very dangerous because
> it allows the user of the html page to specify an arbitrary
> Eclipse goal and execute it on you machine. There are no
> safeguards (apart from the unix permissions) to restrict
> what this goal can do (delete files etc). So under no
> circumstances put this on a public web server... it is
> only for demonstration. Normally you would let eclipse only
> execute a fixed goal and check all user input to this goal
> very carefully.
> 
> 
> There is a different way of achieving the same thing, which
> is not to use an http server and cgi, but to have Eclipse itself
> be the http server. There is a lib(http_server) in the distribution
> which should do that, but I have not really used it recently and
> it might be broken (however, the source is there and you may be
> able to fix it :-)
> 
> Best regards,
> Joachim
> -- 
>  Joachim Schimpf              /             phone: +44 20 7594 8187
>  IC-Parc, Imperial College   /            mailto:J.Schimpf@ic.ac.uk
>  London SW7 2AZ, UK         /    http://www.icparc.ic.ac.uk/eclipse

Kevin
Received on Fri Apr 12 01:38:59 2002

This archive was generated by hypermail 2.1.8 : Wed 16 Nov 2005 06:08:15 PM GMT GMT