[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Re: Security within a ruby interpreter

Tony Targonski

4/12/2005 9:05:00 PM

-----Original Message-----
From: Dominik Werder [mailto:dwerder@gmx.net]
Sent: Tuesday, April 12, 2005 4:50 PM
To: ruby-talk ML
Subject: Security within a ruby interpreter

But how can I be sure that nobody can alter the class at runtime?

Dominik
---------------------------

By using Ruby's safe levels.

$SAFE = 4

Will set the paranoia level to its highest ;) Ruby documentation says
the following:

">= 4 Ruby effectively partitions the running program in two. Nontainted
objects may not be modified. Typically, this will be used to create a
sandbox: the program sets up an environment using a lower $SAFE level,
then resets $SAFE to 4 to prevent subsequent changes to that
environment."

--Tony