The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
FrkyFrkyBox'n ][

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Red Handed

Posts: 1158
Nickname: redhanded
Registered: Dec, 2004

Red Handed is a Ruby-focused group blog.
FrkyFrkyBox'n ][ Posted: Jul 20, 2006 11:39 AM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Red Handed.
Original Post: FrkyFrkyBox'n ][
Feed Title: RedHanded
Feed URL: http://redhanded.hobix.com/index.xml
Feed Description: sneaking Ruby through the system
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Red Handed
Latest Posts From RedHanded

Advertisement

Well, yeah, good progress, many adornments now line the fuzzy coat of Mr. F. F. Snadbox. We’ll draw our gaze to that plastic patch buttoned onto one of the extra buttons of his sleeve. It says extern rb_global_tbl (Audience Compulsion Favorite 2006.)

Here’s the deal: the sandbox won’t be completely safe under 1.8.4 and previous. That’s okay, you’ll still have chance to do some of the neat namespacing tricks. However, it won’t be safe for running untrusted code.

Why not? Well, the global variables will be shared between all sandboxes in 1.8.4. Also, some classes (specifically: MatchData, RegexpError and NameError::message) expose the main namespace. Matz has now given FreakyFreaky some access to swap these out for 1.8.5.

So Sandbox.new will work under both Ruby versions. But Sandbox.safe will only work under 1.8.5.

Anyway, here’s a rundown of the enhancements over the last day:

  • Sandbox imports singletons and constants for the core classes.
  • Added Regexp, Range to the core.
  • Fixed obvious problems with GC and the swapping tables. (The previous symbol table is saved in kit->banished now.)
  • Sandbox.load can be used to load files into the sandbox. (s = Sandbox.new; s.load('pascal.rb'); puts s.eval('pascal(10)'))

You know, RubyQuiz is such a great place to get test scripts for this kind of thing.

Read: FrkyFrkyBox'n ][

Topic: Monkeypytching? Previous Topic   Next Topic Topic: Mucking With Unicode for 1.8

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use