Ticket #1 (assigned defect)

Opened 22 months ago

Last modified 8 months ago

Simple eval not working

Reported by: acrylic Owned by: why
Priority: major Milestone: 0.5
Component: component1 Version: 1.0
Keywords: Cc:

Description

$ cat test.rb 
require "sandbox"
sand = Sandbox.new
p sand.eval("'wtf'.upcase")
$ ruby1.8 test.rb 
/Users/me/Library/ruby/1.8/lib/ruby/site_ruby/1.8/sandbox.rb:73:in `_eval': can't dump anonymous class #<Class:0x1291c> (TypeError)
        from /Users/me/Library/ruby/1.8/lib/ruby/site_ruby/1.8/sandbox.rb:73:in `eval'
        from test.rb:3
$ cat test2.rb 
require "sandbox"
sand = Sandbox.new
sand.eval("def blah() 'blah' end")
sand.eval("blah()")
$ ruby1.8 test2.rb 
(eval):2:in `_eval': #<Class:0x11c9c>: undefined method `blah' for main:Object (Sandbox::Exception)
        from /Users/me/Library/ruby/1.8/lib/ruby/site_ruby/1.8/sandbox.rb:73:in `eval'
        from test2.rb:4
$ svn info
Path: .
URL: http://code.whytheluckystiff.net/svn/sandbox/trunk
Repository Root: http://code.whytheluckystiff.net/svn/sandbox
Repository UUID: 007ef50e-e316-db11-9fa0-00132028b6dc
Revision: 104
Node Kind: directory
Schedule: normal
Last Changed Author: mental
Last Changed Rev: 104
Last Changed Date: 2006-10-06 01:36:26 +0200 (Fri, 06 Oct 2006)

It seems most tests are failing also.

Change History

Changed 22 months ago by why

  • owner changed from somebody to why
  • status changed from new to assigned
  • version set to 1.0
  • milestone set to 0.5

We're totally overhauling everything right now, so head back to rev [100], please.

Changed 8 months ago by robhu

Is this still broken? Using the latest revision (156?)?

p sand.eval("'wtf'.upcase")

works, but

sand.eval("def blah() 'blah' end")
sand.eval("blah()")

Does not.

def self.blah works though.

I'd rather not go back to rev 100 as the change log suggests there have been security fixes since then ;

Note: See TracTickets for help on using tickets.