[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

safe domain specific language implementation

John Miller

9/8/2006 6:21:00 PM

Greeting All,

I am trying to write code that will interpret user submitted scripts in
a secure way. I have a limited set of functions that they should be
able to call to change various states. I also need the usual branching,
loping, and local variable assignment types of things. (see example
code) I hoped to be able to use Rubyâ??s safe mode for this is ways
similar to http://www.artima.com/rubycs/articles/ruby_as...

I have a few questions in this regard:

1). Are there any websites/articles that deal with how to use $SAFE
(particularly level 4)

2). In light of http://code.whytheluckystiff.net/sa... is this a
feature that is still in development? (please also see
http://www.ruby-...topic/79...)

3). What are some implementation options? What would be required in
terms of programming?

Thanks

J.F. Miller


=====
Example code

#entrusted user script

#call this function when a power shortage is detected
def power_shortfall
pl = get_power_reading
if pl<100
shutdown_expermint
else
reduse_load(1000-pl/10)
end
end

--
Posted via http://www.ruby-....

3 Answers

Lord Valve

9/16/2012 4:06:00 PM

0

Gerry wrote:

> On 2012-09-16 10:05:24 +0000, RS said:
>
> > I hope that knowledgable posters don't leave rmmgj in similar fashion.
> > There's no
> > reason to regard him as anything more than another loud Usenet loon.
>
> It's just a matter of whether regular humans here learn to break their
> otherwise honorable intentions by responding to him. Under the
> circumstances they frequently don't understand that to acknowledge his
> outrageous behaviour at all is to provide him the spankings that he
> longs for so desparately.
> --
> Music is the best means we have of digesting time. -- W. H. Auden

http://www.youtube.com/watch?v=x...


mlhartman

9/16/2012 5:31:00 PM

0

On Sunday, September 16, 2012 10:49:11 AM UTC-4, Gerry wrote:
> On 2012-09-16 10:05:24 +0000, RS said:
>
>
>
> > I hope that knowledgable posters don't leave rmmgj in similar fashion.
>
> > There's no
>
> > reason to regard him as anything more than another loud Usenet loon.
>
>
>
> It's just a matter of whether regular humans here learn to break their
>
> otherwise honorable intentions by responding to him. Under the
>
> circumstances they frequently don't understand that to acknowledge his
>
> outrageous behaviour at all is to provide him the spankings that he
>
> longs for so desparately.
>
> --
>
> Music is the best means we have of digesting time. -- W. H. Auden

Someone has managed to mark most of his posts, earlier on this thread, as abuse and they don't show, except for his last post, which does show. Thanks for whoever did that. I don't know how it works, but it is a welcome service to this news group.

Lord Valve

9/16/2012 10:24:00 PM

0

mlhconductor@gmail.com wrote:

> On Sunday, September 16, 2012 10:49:11 AM UTC-4, Gerry wrote:
> > On 2012-09-16 10:05:24 +0000, RS said:
> >
> >
> >
> > > I hope that knowledgable posters don't leave rmmgj in similar fashion.
> >
> > > There's no
> >
> > > reason to regard him as anything more than another loud Usenet loon.
> >
> >
> >
> > It's just a matter of whether regular humans here learn to break their
> >
> > otherwise honorable intentions by responding to him. Under the
> >
> > circumstances they frequently don't understand that to acknowledge his
> >
> > outrageous behaviour at all is to provide him the spankings that he
> >
> > longs for so desparately.
> >
> > --
> >
> > Music is the best means we have of digesting time. -- W. H. Auden
>
> Someone has managed to mark most of his posts, earlier on this thread, as abuse and they don't show, except for his last post, which does show. Thanks for whoever did that. I don't know how it works, but it is a welcome service to this news group.

It works both ways, dweeb.

LV