[#8484] strptime fails to properly parse certain inputs — <noreply@...>

Bugs item #5263, was opened at 2006-08-01 23:14

13 messages 2006/08/02
[#8485] Re: [ ruby-Bugs-5263 ] strptime fails to properly parse certain inputs — Yukihiro Matsumoto <matz@...> 2006/08/02

Hi,

[#8538] Re: [ ruby-Bugs-5263 ] strptime fails to properly parse certain inputs — nobu@... 2006/08/06

Hi,

[#8561] sandbox timers & block scopes — why the lucky stiff <ruby-core@...>

Two puzzles I am trying to solve:

28 messages 2006/08/08
[#8624] Re: sandbox timers & block scopes — why the lucky stiff <ruby-core@...> 2006/08/15

raise ThisDecayingInquisition, "anyone? anyone at all?"

[#8627] Re: sandbox timers & block scopes — MenTaLguY <mental@...> 2006/08/15

On Wed, 2006-08-16 at 00:35 +0900, why the lucky stiff wrote:

[#8628] Re: sandbox timers & block scopes — why the lucky stiff <ruby-core@...> 2006/08/15

On Wed, Aug 16, 2006 at 02:46:30AM +0900, MenTaLguY wrote:

[#8629] Re: sandbox timers & block scopes — "Charles O Nutter" <headius@...> 2006/08/15

On 8/15/06, why the lucky stiff <ruby-core@whytheluckystiff.net> wrote:

[#8690] a ruby-core primer — why the lucky stiff <ruby-core@...>

Hello, all. I've been working on the ruby-core page for the new Ruby site.

21 messages 2006/08/22

sandbox r47, exposing top_cref v. emulating require

From: why the lucky stiff <ruby-core@...>
Date: 2006-08-30 06:40:09 UTC
List: ruby-core #8755
Finally, some big developments for the sandbox.  I've got it running RubyGems!

  box = Sandbox.new :init => [:all] 
  box.eval %{
    require 'rubygems'
    Gem.manage_gems
    p Gem.source_index
  }
  
This revision requires you to patch 1.8.5 to expose top_cref. (see attached)

  svn co http://code.whytheluckystiff.net/svn/sandbox/trunk sandbox

The reason for swapping top_cref is because it is placed into ruby_cref by Ruby
when any rb_load happens.  So, you end up with the right `main`.  I had thought
about emulating `require`, but it seems foolish to emulate some things and swap
others.  If I keep a list of everything that needs to be swapped, then the
procedure for native sandboxes in Ruby is known.

Anyway, emulating require isn't a good option, since the sandbox should be able
to load shared objects, if initialized to allow it.

Also, I'm using Object.module_eval(str) to do the initial eval.  Because the
only options are rb_obj_instance_eval and rb_mod_module_eval.  I would like
to be able to swap ruby_cref and then run rb_eval_string.

_why

Attachments (1)

ruby-1.8.5-top_cref_exposed.patch (755 Bytes, text/x-diff)
diff -wur ruby-1.8.5/eval.c ruby-1.8.5-top_cref_exposed/eval.c
--- ruby-1.8.5/eval.c	Sun Aug  6 21:43:39 2006
+++ ruby-1.8.5-top_cref_exposed/eval.c	Wed Aug 30 01:42:28 2006
@@ -1062,7 +1062,7 @@
 } while (0)
 
 static NODE *ruby_cref = 0;
-static NODE *top_cref;
+NODE *top_cref;
 #define PUSH_CREF(c) ruby_cref = NEW_NODE(NODE_CREF,(c),0,ruby_cref)
 #define POP_CREF() ruby_cref = ruby_cref->nd_next
 
diff -wur ruby-1.8.5/node.h ruby-1.8.5-top_cref_exposed/node.h
--- ruby-1.8.5/node.h	Mon Feb 13 02:10:53 2006
+++ ruby-1.8.5-top_cref_exposed/node.h	Wed Aug 30 01:42:40 2006
@@ -151,6 +151,8 @@
     } u3;
 } NODE;
 
+extern NODE *top_cref;
+
 #define RNODE(obj)  (R_CAST(RNode)(obj))
 
 #define nd_type(n) ((int)(((RNODE(n))->flags>>FL_USHIFT)&0xff))

In This Thread

Prev Next