From: Tony Arcieri Date: 2013-02-13T09:13:09+09:00 Subject: Re: Why doesn't Ruby have a built in sandbox class? --047d7b67824802221204d5900137 Content-Type: text/plain; charset=ISO-8859-1 Wow, I wasn't aware $SAFE=4 was quite that powerful. Too bad it doesn't work on JRuby or I might seriously consider using it ;) On Tue, Feb 12, 2013 at 2:37 AM, Ano Hito wrote: > Tony Arcieri wrote in post #1096413: > > I posted a strawman for something similar a few days ago. It's a bit > > different idea from yours and a super-granular class whitelist: > > > > https://gist.github.com/tarcieri/4719525 > > > > Clearly that doesn't cover all the "NO" cases, but I hope it gives you a > > general idea > > Creating a secure context inside of a block would certainly be more > rubylike than $SAFE = 4. But would you allow for managing what classes > and methods are allowed to be used in a SecureContext? Otherwise it's > not that different from just running the code in a new thread after > setting $SAFE = 4 in the thread's context. > > -- > Posted via http://www.ruby-forum.com/. > > -- Tony Arcieri --047d7b67824802221204d5900137 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Wow, I wasn't aware $SAFE=3D4 was quite that powerful.= Too bad it doesn't work on JRuby or I might seriously consider using i= t ;)


On = Tue, Feb 12, 2013 at 2:37 AM, Ano Hito <lists@ruby-forum.com> wrote:
Tony Arcieri wrote in post #1096413:
> I posted a strawman for something similar a few days= ago. It's a bit
> different idea from yours and a super-granular class whitelist:
>
> https://gist.github.com/tarcieri/4719525
>
> Clearly that doesn't cover all the "NO" cases, but I hop= e it gives you a
> general idea

Creating a secure context inside of a block would certainly be more rubylike than $SAFE =3D 4. But would you allow for managing what classes and methods are allowed to be used in a SecureContext? Otherwise it's not that different from just running the code in a new thread after
setting $SAFE =3D 4 in the thread's context.



--
= Tony Arcieri
--047d7b67824802221204d5900137--