Changeset 151
- Timestamp:
- 10/10/2007 14:43:25 (12 months ago)
- Files:
-
- 1 modified
-
trunk/ext/sand_table/sand_table.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ext/sand_table/sand_table.c
r150 r151 21 21 22 22 static VALUE Qimport, Qset, Qinit, Qload, Qenv, Qio, Qreal, Qref, Qall; 23 VALUE rb_cSandbox, rb_cSandboxFull, rb_cSandboxSafe, rb_eSandboxException, rb_cSandboxRef, rb_cSandboxWick, rb_cSandboxTransfer; 23 VALUE rb_cSandbox, rb_cSandboxFull, rb_cSandboxSafe, rb_eSandboxException, rb_cSandboxRef, 24 rb_cSandboxWick, rb_cSandboxTransfer, rb_aUnsafeMethods; 24 25 static ID s_options, s_to_s, s_set_ivar, s_marshal_dump; 25 26 … … 1051 1052 /* FIXME: oh, wait, this shouldn't happen! */ 1052 1053 rb_raise(rb_eNoMethodError, "no link for %s", RSTRING(rb_inspect(self))->ptr); 1054 } else if (!SYMBOL_P(argv[0])) { 1055 rb_raise(rb_eArgError, "method_missing expects a symbolized method name"); 1056 } else if (rb_ary_includes(rb_aUnsafeMethods, argv[0])) { 1057 rb_raise(rb_eArgError, "method cannot be called"); 1053 1058 } else { 1054 1059 int i; … … 3172 3177 void Init_sand_table() 3173 3178 { 3179 long i; 3180 VALUE obj_methods = rb_class_instance_methods(0, NULL, rb_cObject); 3181 3174 3182 ruby_sandbox_save = sandbox_save; 3175 3183 ruby_sandbox_restore = sandbox_restore; … … 3180 3188 Init_kit_env(&base, 0); 3181 3189 Init_kit_real(&base, 0); 3190 3191 rb_aUnsafeMethods = rb_ary_new(); 3192 for (i = 0; i < RARRAY_LEN(obj_methods); i++) 3193 rb_ary_push(rb_aUnsafeMethods, rb_str_intern(rb_ary_entry(obj_methods, i))); 3194 rb_global_variable(&rb_aUnsafeMethods); 3182 3195 3183 3196 rb_cSandbox = rb_define_module("Sandbox");
