[#16098] Testing hangs latest ruby 1.9 — Tommy Nordgren <tommy.nordgren@...>
When testing locally built ruby with make check,
[#16116] RCRchive shutting down — "David A. Black" <dblack@...>
Hi everyone --
This is quite sad news, I feel that a mailing list does not offer all
Hi,
On Thu, Apr 3, 2008 at 12:01 PM, Yukihiro Matsumoto <matz@ruby-lang.org> wrote:
Hi,
On Thu, Apr 3, 2008 at 1:13 PM, Yukihiro Matsumoto <matz@ruby-lang.org> wrote:
Hi,
Can I ask the Trac naysayers what's wrong with it?
On 04/04/2008, mathew <meta@pobox.com> wrote:
Coming to Trac's defense:
[#16128] RUBY_IMPLEMENTATION — Yukihiro Matsumoto <matz@...>
Hi,
Yukihiro Matsumoto wrote:
Hello,
On Thu, Apr 03, 2008 at 11:41:41PM +0900, Yukihiro Matsumoto wrote:
On Apr 3, 2008, at 10:59 AM, Paul Brannan wrote:
Hi,
Ezra Zygmuntowicz wrote:
Hello,
Yemi I. D. Bedu wrote:
On 4 Apr 2008, at 00:23, Charles Oliver Nutter wrote:
On 4-Apr-08, at 3:05 AM, Eleanor McHugh wrote:
On Fri, Apr 4, 2008 at 2:15 PM, Chris Cummer <chris@postal-code.com> wrote:
On Sat, 2008-04-05 at 02:23 +0900, Luis Lavena wrote:
On 4-Apr-08, at 11:04 AM, Alex Young wrote:
On Sat, 2008-04-05 at 03:35 +0900, Chris Cummer wrote:
[#16171] accomplishing compatibility (was Re: RUBY_IMPLEMENTATION) — "Meinrad Recheis" <meinrad.recheis@...>
On Fri, Apr 4, 2008 at 11:02 AM, Meinrad Recheis
On 4 Apr 2008, at 10:28, Meinrad Recheis wrote:
[#16216] unable to set $0 from C extension — "Suraj N. Kurapati" <sunaku@...>
Hello,
[#16223] Sigsegv out of Dir.pos in ruby_1_8 branch — "Vladimir Sizikov" <vsizikov@...>
Hi,
> -----Original Message-----
[#16231] Sigsegv when running Kernel rubysecs with ruby_1_8 branch — "Vladimir Sizikov" <vsizikov@...>
Hi,
Vladimir Sizikov wrote:
[#16240] syntax request — "ry dahl" <ry@...>
Often times when one has many long arguments and orders them like this
ry dahl wrote:
> Good point! I always just thought that would work, because the parser
ry dahl wrote:
On Sun, Apr 6, 2008 at 2:44 PM, ry dahl <ry@tinyclouds.org> wrote:
Hi --
On 4/7/2008 10:00 AM, David A. Black wrote:
On Tue, 8 Apr 2008, Bill Kelly wrote:
On Tue, Apr 08, 2008 at 02:23:26PM +0900, David A. Black wrote:
At 00:02 08/04/09, Paul Brannan wrote:
On Wed, Apr 09, 2008 at 05:54:18PM +0900, Martin Duerst wrote:
> This is one use of method chaining I dislike.
[#16283] Marshal and singleton.rb - bug? — "Chris Shea" <cmshea@...>
Core,
[#16286] Complex, Rational, etc. — David Flanagan <david@...>
In addition to moving the Complex and Rational classes from stdlib to
[#16287] require_relative — David Flanagan <david@...>
I see that there is now a require_relative.rb module in the lib/
Hi,
[#16290] Could someone confirm signal handling is broken on OSX? — Dave Thomas <dave@...>
I've raised this before, but no one replied. I'd like to double check
[#16306] Hash.compare_by_identity — David Flanagan <david@...>
I saw this note about Hash#compare_by_identity at
[#16327] How can I demonstrate that weakref works in 1.9? — Dave Thomas <dave@...>
Hi --
[#16359] design meeting — Yukihiro Matsumoto <matz@...>
Hi,
Hi,
SASADA Koichi wrote:
Hi,
[#16371] ruby_init() and C call stack — "Suraj N. Kurapati" <sunaku@...>
Hello,
Hi,
Yukihiro Matsumoto wrote:
Suraj N. Kurapati wrote:
Hi,
[#16378] cross-platform1: st1.dev == st2.dev and st1.ino == st2.ino considered harmful — Thomas Enebo <Thomas.Enebo@...>
I propose we add something which makes this system-specific code go away:
Thomas Enebo wrote:
Urabe Shyouhei wrote:
[#16385] Where's DATA? — Trans <transfire@...>
Anyone have any idea why I would be getting?
On Apr 14, 2008, at 07:21 AM, Trans wrote:
> On Apr 14, 8:23 pm, Eric Hodel <drbr...@segment7.net> wrote:
[#16395] RFC: VM Instruction Manipulation gem(s)? — "Rocky Bernstein" <rocky.bernstein@...>
Is anyone aware of or working on a package/gem for facilitation VM
On Wed, Apr 16, 2008 at 01:02:42AM +0900, Rocky Bernstein wrote:
[#16397] Ruby 1.8.7-preview1 has been released — "Akinori MUSHA" <knu@...>
Folks,
-----BEGIN PGP SIGNED MESSAGE-----
Hi,
[#16427] Rails broken with 1.8.7 bc Symbol#to_proc — Ola Bini <ola.bini@...>
Hi,
[#16462] revision number in ruby -v (1.9) — Joel VanderWerf <vjoel@...>
[#16478] BUS error in string manip — ara howard <ara.t.howard@...>
[#16482] Performance on method dispatch for methods defined via define_method — "Robert Dober" <robert.dober@...>
Hi
On Wed, Apr 23, 2008 at 12:39:29AM +0900, Robert Dober wrote:
On Tue, Apr 22, 2008 at 8:46 PM, Paul Brannan <pbrannan@atdesk.com> wrote:
Hi --
On Tue, Apr 22, 2008 at 10:44 PM, David A. Black <dblack@rubypal.com> wrote:
Hi --
David A. Black wrote:
Charles Oliver Nutter wrote:
Joel VanderWerf wrote:
Robert Dober wrote:
On Wed, Apr 23, 2008 at 10:37 AM, ts <decoux@moulon.inra.fr> wrote:
Robert Dober wrote:
On Wed, Apr 23, 2008 at 10:37 AM, ts <decoux@moulon.inra.fr> wrote:
Robert Dober wrote:
On Wed, Apr 23, 2008 at 11:25 AM, ts <decoux@moulon.inra.fr> wrote:
[#16507] Drop :: as a . synonym — "David A. Black" <dblack@...>
Hi --
David A. Black wrote:
Hi --
David A. Black wrote:
Hi --
David A. Black wrote:
Hi --
Or changing #send to private...or (insert progressive but code
Jeremy McAnally wrote:
Hi --
Hi,
Hi Matz --
On Fri, Apr 25, 2008 at 04:49:00AM +0900, David A. Black wrote:
Hi --
On Fri, Apr 25, 2008 at 1:27 AM, David A. Black <dblack@rubypal.com> wrote:
Hi --
On Fri, Apr 25, 2008 at 12:24 PM, David A. Black <dblack@rubypal.com> wrote:
On Fri, Apr 25, 2008 at 08:34:20PM +0900, Nikolai Weibull wrote:
And why would you want to do that with dots? Because _JRuby_ requires it?
On Wed, Apr 23, 2008 at 9:21 AM, David A. Black <dblack@rubypal.com> wrote:
Eric Mahurin wrote:
Eric Mahurin wrote:
[#16517] RFC: #19733 - dln_find_1 prioritizes posix naming conventions over Operating System naming conventions. — "Luis Lavena" <luislavena@...>
Hello ruby-core developers.
Hi,
[#16526] Any reason for having no module exclusion functionality in Ruby — "Pit Capitain" <pit.capitain@...>
Hi all, I'm forwarding the following message for Yurii, who seems to
+1.
Yehuda Katz wrote:
I want to +1 this again and reraise it for consideration.
[#16554] Action Item: RubySpec failures on Ruby 1.8.7 — "Vladimir Sizikov" <vsizikov@...>
Hi,
[#16576] sandbox API — _why <why@...>
Hi, everybody.
[#16599] Repeatable bug in Net::Telnet EOL translation — Brian Candler <B.Candler@...>
I have found a bug in Net::Telnet - it only occurs infrequently, and
> I'm helping out with the maintenance of net/telnet these days
[RCR] sandbox API
Hi, everybody.
In the #ruby-core design meeting, during the discussion about MVM,
there was some mention of the sandbox API. I thought it would be
worth while to write up an RCR. I mean: all though there has been
some talk about the sandbox extension for Ruby 1.8 on this list,
there hasn't been any talk about the API itself.
Considering that $SAFE has fallen out of use and there is a renewed
interest in managing many namespaces/environments on a single VM,
I figured hey.
ABSTRACT
Ruby of yore has only had one interpreter environment. The sandbox
API gives that central environment a means of creating other
in-process environments for executing code. Be it restricted
sandboxes for running unsafe code or fully-featured sandboxes to
offer a clean namespace.
PROS & CONS
The benefits of this particular API:
* Rather simple (yeah?)
* Basic (albeit unstable) extensions exist for Ruby 1.8 and JRuby.
* Patterned after other successful sandboxes (such as Firefox's
XPCNativeWrapper[1] and Io's Sandbox[2])
* Generic enough to work in other Ruby impls.
The drawbacks are:
* Not fully proven on Ruby 1.8.
* My extension does rely on Thread.kill! to stop a Sandbox,
which is taboo. (Same problem timeout.rb has.)
* Haven't worked out how tainting could play out.
* Could be closer coupled with threading to offer concurrent
interps in separate threads.
THE API
All classes and methods are enclosed in the Sandbox module.
The primary classes are Sandbox::Full and Sandbox::Safe.
Sandbox::Safe is descended from Sandbox::Full.
Methods for these two classes are:
* self.new(opts = {})
Returns a newly created sandbox.
Available options: :init, :ref
* eval(str, opts = {}) => obj
Evaluates +str+ as Ruby code inside the sandbox
and returns the result.
Available options: :timeout
* load(io, opts = {}) => nil
At heart, just an alias for: eval(IO.read(io), opts)
* ref(klass) => nil
Adds a boxed reference to +klass+ in the sandbox.
(Ex.: @box.ref(YAML) would create a YAML class in the
sandbox which is derived from Sandbox::BoxedClass, a
proxy to the YAML class on the outside.)
* require(str)
Requires a file into the Sandbox, using the $LOAD_PATH and
file permissions of the current sandbox.
The Sandbox module itself has a few methods:
* Sandbox.safe(opts = {})
An alias for Sandbox::Safe.new(opts)
* Sandbox.new(opts = {})
An alias for Sandbox::Full.new(opts)
* Sandbox.current
Returns an object representing the current Sandbox.
* Sandbox.screen(obj) => true or Sandbox::ScreenException
Traverses an object and its related symbols to be sure
it is entirely composed of objects from the current
sandbox. Purely for testing.
As for the `opts` hash in the above methods, here's a brief
description of those:
* init: The portions of Ruby core to initialize.
:load - $:, $-I, $LOAD_PATH, $\, $LOADED_FEATURES,
load, require, autoload, autoload?
:io - IOError, EOFError, IO, FileTest, File, Dir,
File::Constants, test, File::Stat,
:env - syscall, open, printf, print, putc, puts,
gets, readline, getc, select, readlines,
p, display, STDIN, STDOUT, STDERR
:real - abort, at_exit, caller, exit, trace_var,
untrace_var, set_trace_func, warn, ThreadError
Thread, Continuation, ThreadGroup, trap,
exec, fork, exit!, system, `, sleep, Process,
Process::Status, Process::Sys, GC,
ObjectSpace, hash, __id__, object_id
:all - the whole enchilada
(Sandbox::Full assumes :init => :all and Sandbox::Safe
assumes :init => nil.)
* ref: Classes to create boxed references for.
(Ex.: :ref => [RedCloth, BlueCloth])
* timeout: Maximum seconds, a time limit for the sandbox.
BOXED CLASSES
Inside each Sandbox, a BoxedClass constant is defined. This class
has two methods: method_missing and const_missing.
So, let's say you're running a web app in the sandbox. And you
want it to speak to Mongrel in the main interp. Imagine a
MongrelConnector class that acts as medium between the two.
-- master.rb --
require 'mongrel'
class MongrelConnector
def self.each
str = yield ""
# send str to mongrel
end
end
box = Sandbox.safe
box.load 'rails.rb'
box.ref MongrelConnector
box.eval 'start'
-- web.rb --
def start
MongrelConnector.each do |cgi|
cgi << "hallo!"
end
end
Inside the sandbox (where web.rb is running,) the MongrelConnector
class is a BoxedClass. When `each` is called, method_missing
switches sandboxes and runs the method on the class outside the box.
When method_missing gets an answer back, it switches back inside the
sandbox and returns an answer.
For primitive data, such as numbers and strings and floats which
have no instance variables, the data is marshalled. For other
objects, a Sandbox::Ref is received. Both inside and outside the
sandbox, a Sandbox::Ref points to data not inside the current
sandbox. This ref also has a method_missing, which works just like
BoxedClass' method_missing.
It is not allowed to pass a Sandbox::Ref for an object whose class
is not referred to in the receiving sandbox. So, if, for some
reason, a method call tries to return an IO object to a sandbox and
no IO class is defined (and properly ref'd,) a
Sandbox::TransferException is thrown.
THE PRELUDE
Beyond the API, it is also required that the Sandbox run versions of
common methods which are not exploitable. For example, the freaky
freaky sandbox has a lib/sandbox/prelude.rb which includes a pure
Ruby version of the `**` method since very high squares can lock the
interpreter up in C.
AND DONE
That's it for now. I'm not an extreme zealot of this API, so I'd be
glad to alter it or scrap it. But it has evolved through trial and
error, based on xp points awarded during Try Ruby and the
sandboxed wiki[3].
Thankyou for your generous attentions.
[1] http://developer.mozilla.org/en/docs/XPCNativeWrapper
[2] http://iolanguage.com/scm/git/checkout/Io/docs/IoReference.html
[3] http://redhanded.hobix.com/inspect/howToLetAnyoneElseFinishYourWiki.html