diff -wur ruby-1.8.5/error.c ruby-1.8.5-sandbox/error.c
|
old
|
new
|
|
| 827 | 827 | * Errno.constants #=> E2BIG, EACCES, EADDRINUSE, EADDRNOTAVAIL, ... |
| 828 | 828 | */ |
| 829 | 829 | |
| 830 | | static st_table *syserr_tbl; |
| | 830 | st_table *rb_syserr_tbl; |
| 831 | 831 | |
| 832 | 832 | static VALUE |
| 833 | 833 | set_syserr(n, name) |
| … |
… |
|
| 836 | 836 | { |
| 837 | 837 | VALUE error; |
| 838 | 838 | |
| 839 | | if (!st_lookup(syserr_tbl, n, &error)) { |
| | 839 | if (!st_lookup(rb_syserr_tbl, n, &error)) { |
| 840 | 840 | error = rb_define_class_under(rb_mErrno, name, rb_eSystemCallError); |
| 841 | 841 | rb_define_const(error, "Errno", INT2NUM(n)); |
| 842 | | st_add_direct(syserr_tbl, n, error); |
| | 842 | st_add_direct(rb_syserr_tbl, n, error); |
| 843 | 843 | } |
| 844 | 844 | else { |
| 845 | 845 | rb_define_const(rb_mErrno, name, error); |
| … |
… |
|
| 853 | 853 | { |
| 854 | 854 | VALUE error; |
| 855 | 855 | |
| 856 | | if (!st_lookup(syserr_tbl, n, &error)) { |
| | 856 | if (!st_lookup(rb_syserr_tbl, n, &error)) { |
| 857 | 857 | char name[8]; /* some Windows' errno have 5 digits. */ |
| 858 | 858 | |
| 859 | 859 | snprintf(name, sizeof(name), "E%03d", n); |
| … |
… |
|
| 891 | 891 | if (argc == 1 && FIXNUM_P(mesg)) { |
| 892 | 892 | error = mesg; mesg = Qnil; |
| 893 | 893 | } |
| 894 | | if (!NIL_P(error) && st_lookup(syserr_tbl, NUM2LONG(error), &klass)) { |
| | 894 | if (!NIL_P(error) && st_lookup(rb_syserr_tbl, NUM2LONG(error), &klass)) { |
| 895 | 895 | /* change class */ |
| 896 | 896 | if (TYPE(self) != T_OBJECT) { /* insurance to avoid type crash */ |
| 897 | 897 | rb_raise(rb_eTypeError, "invalid instance type"); |
| … |
… |
|
| 1031 | 1031 | rb_eSecurityError = rb_define_class("SecurityError", rb_eStandardError); |
| 1032 | 1032 | rb_eNoMemError = rb_define_class("NoMemoryError", rb_eException); |
| 1033 | 1033 | |
| 1034 | | syserr_tbl = st_init_numtable(); |
| | 1034 | rb_syserr_tbl = st_init_numtable(); |
| 1035 | 1035 | rb_eSystemCallError = rb_define_class("SystemCallError", rb_eStandardError); |
| 1036 | 1036 | rb_define_method(rb_eSystemCallError, "initialize", syserr_initialize, -1); |
| 1037 | 1037 | rb_define_method(rb_eSystemCallError, "errno", syserr_errno, 0); |
diff -wur ruby-1.8.5/eval.c ruby-1.8.5-sandbox/eval.c
|
old
|
new
|
|
| 29 | 29 | #endif |
| 30 | 30 | |
| 31 | 31 | #include <stdio.h> |
| 32 | | #if defined(HAVE_GETCONTEXT) && defined(HAVE_SETCONTEXT) |
| 33 | | #include <ucontext.h> |
| 34 | | #define USE_CONTEXT |
| 35 | | #endif |
| 36 | | #include <setjmp.h> |
| 37 | 32 | |
| 38 | 33 | #include "st.h" |
| 39 | 34 | #include "dln.h" |
| … |
… |
|
| 90 | 85 | #endif |
| 91 | 86 | |
| 92 | 87 | #ifdef USE_CONTEXT |
| 93 | | typedef struct { |
| 94 | | ucontext_t context; |
| 95 | | volatile int status; |
| 96 | | } rb_jmpbuf_t[1]; |
| 97 | 88 | |
| 98 | 89 | NORETURN(static void rb_jump_context(rb_jmpbuf_t, int)); |
| 99 | 90 | static inline void |
| … |
… |
|
| 201 | 192 | POST_GETCONTEXT, \ |
| 202 | 193 | (j)->status) |
| 203 | 194 | #else |
| 204 | | typedef jmp_buf rb_jmpbuf_t; |
| 205 | 195 | # if !defined(setjmp) && defined(HAVE__SETJMP) |
| 206 | 196 | # define ruby_setjmp(env) _setjmp(env) |
| 207 | 197 | # define ruby_longjmp(env,val) _longjmp(env,val) |
| … |
… |
|
| 250 | 240 | #define SCOPE_SET(f) (scope_vmode=(f)) |
| 251 | 241 | #define SCOPE_TEST(f) (scope_vmode&(f)) |
| 252 | 242 | |
| | 243 | VALUE (*ruby_sandbox_save)(struct thread *) = NULL; |
| | 244 | VALUE (*ruby_sandbox_restore)(struct thread *) = NULL; |
| 253 | 245 | NODE* ruby_current_node; |
| 254 | 246 | int ruby_safe_level = 0; |
| 255 | 247 | /* safe-level: |
| … |
… |
|
| 1061 | 1053 | #define POP_CLASS() ruby_class = _class; \ |
| 1062 | 1054 | } while (0) |
| 1063 | 1055 | |
| 1064 | | static NODE *ruby_cref = 0; |
| 1065 | | static NODE *top_cref; |
| | 1056 | NODE *ruby_cref = 0; |
| | 1057 | NODE *ruby_top_cref; |
| 1066 | 1058 | #define PUSH_CREF(c) ruby_cref = NEW_NODE(NODE_CREF,(c),0,ruby_cref) |
| 1067 | 1059 | #define POP_CREF() ruby_cref = ruby_cref->nd_next |
| 1068 | 1060 | |
| … |
… |
|
| 1078 | 1070 | ruby_scope = _scope; \ |
| 1079 | 1071 | scope_vmode = SCOPE_PUBLIC |
| 1080 | 1072 | |
| 1081 | | typedef struct thread * rb_thread_t; |
| 1082 | | static rb_thread_t curr_thread = 0; |
| 1083 | | static rb_thread_t main_thread; |
| | 1073 | rb_thread_t curr_thread = 0; |
| | 1074 | rb_thread_t main_thread; |
| 1084 | 1075 | static void scope_dup _((struct SCOPE *)); |
| 1085 | 1076 | |
| 1086 | 1077 | #define POP_SCOPE() \ |
| … |
… |
|
| 1391 | 1382 | rb_call_inits(); |
| 1392 | 1383 | ruby_class = rb_cObject; |
| 1393 | 1384 | ruby_frame->self = ruby_top_self; |
| 1394 | | top_cref = rb_node_newnode(NODE_CREF,rb_cObject,0,0); |
| 1395 | | ruby_cref = top_cref; |
| | 1385 | ruby_top_cref = rb_node_newnode(NODE_CREF,rb_cObject,0,0); |
| | 1386 | ruby_cref = ruby_top_cref; |
| 1396 | 1387 | rb_define_global_const("TOPLEVEL_BINDING", rb_f_binding(ruby_top_self)); |
| 1397 | 1388 | #ifdef __MACOS__ |
| 1398 | 1389 | _macruby_init(); |
| … |
… |
|
| 1437 | 1428 | static int thread_set_raised(); |
| 1438 | 1429 | static int thread_reset_raised(); |
| 1439 | 1430 | |
| | 1431 | static int thread_no_ensure _((void)); |
| | 1432 | |
| 1440 | 1433 | static VALUE exception_error; |
| 1441 | 1434 | static VALUE sysstack_error; |
| 1442 | 1435 | |
| … |
… |
|
| 3307 | 3300 | result = rb_eval(self, node->nd_head); |
| 3308 | 3301 | } |
| 3309 | 3302 | POP_TAG(); |
| 3310 | | if (node->nd_ensr) { |
| | 3303 | if (node->nd_ensr && !thread_no_ensure()) { |
| 3311 | 3304 | VALUE retval = prot_tag->retval; /* save retval */ |
| 3312 | 3305 | VALUE errinfo = ruby_errinfo; |
| 3313 | 3306 | |
| … |
… |
|
| 4740 | 4733 | return Qfalse; |
| 4741 | 4734 | } |
| 4742 | 4735 | |
| 4743 | | static VALUE rb_eThreadError; |
| | 4736 | VALUE rb_eThreadError; |
| 4744 | 4737 | |
| 4745 | 4738 | NORETURN(static void proc_jump_error(int, VALUE)); |
| 4746 | 4739 | static void |
| … |
… |
|
| 5453 | 5446 | } |
| 5454 | 5447 | POP_TAG(); |
| 5455 | 5448 | retval = prot_tag ? prot_tag->retval : Qnil; /* save retval */ |
| | 5449 | if (!thread_no_ensure()) { |
| 5456 | 5450 | (*e_proc)(data2); |
| | 5451 | } |
| 5457 | 5452 | if (prot_tag) return_value(retval); |
| 5458 | 5453 | if (state) JUMP_TAG(state); |
| 5459 | 5454 | return result; |
| … |
… |
|
| 6797 | 6792 | ruby_errinfo = Qnil; /* ensure */ |
| 6798 | 6793 | PUSH_VARS(); |
| 6799 | 6794 | PUSH_CLASS(ruby_wrapper); |
| 6800 | | ruby_cref = top_cref; |
| | 6795 | ruby_cref = ruby_top_cref; |
| 6801 | 6796 | if (!wrap) { |
| 6802 | 6797 | rb_secure(4); /* should alter global state */ |
| 6803 | 6798 | ruby_class = rb_cObject; |
| … |
… |
|
| 9757 | 9752 | |
| 9758 | 9753 | extern VALUE rb_last_status; |
| 9759 | 9754 | |
| 9760 | | enum thread_status { |
| 9761 | | THREAD_TO_KILL, |
| 9762 | | THREAD_RUNNABLE, |
| 9763 | | THREAD_STOPPED, |
| 9764 | | THREAD_KILLED, |
| 9765 | | }; |
| 9766 | | |
| 9767 | 9755 | #define WAIT_FD (1<<0) |
| 9768 | 9756 | #define WAIT_SELECT (1<<1) |
| 9769 | 9757 | #define WAIT_TIME (1<<2) |
| … |
… |
|
| 9781 | 9769 | # endif |
| 9782 | 9770 | #endif |
| 9783 | 9771 | |
| 9784 | | /* typedef struct thread * rb_thread_t; */ |
| 9785 | | |
| 9786 | | struct thread { |
| 9787 | | struct thread *next, *prev; |
| 9788 | | rb_jmpbuf_t context; |
| 9789 | | #ifdef SAVE_WIN32_EXCEPTION_LIST |
| 9790 | | DWORD win32_exception_list; |
| 9791 | | #endif |
| 9792 | | |
| 9793 | | VALUE result; |
| 9794 | | |
| 9795 | | long stk_len; |
| 9796 | | long stk_max; |
| 9797 | | VALUE *stk_ptr; |
| 9798 | | VALUE *stk_pos; |
| 9799 | | #ifdef __ia64__ |
| 9800 | | VALUE *bstr_ptr; |
| 9801 | | long bstr_len; |
| 9802 | | #endif |
| 9803 | | |
| 9804 | | struct FRAME *frame; |
| 9805 | | struct SCOPE *scope; |
| 9806 | | struct RVarmap *dyna_vars; |
| 9807 | | struct BLOCK *block; |
| 9808 | | struct iter *iter; |
| 9809 | | struct tag *tag; |
| 9810 | | VALUE klass; |
| 9811 | | VALUE wrapper; |
| 9812 | | NODE *cref; |
| 9813 | | |
| 9814 | | int flags; /* misc. states (vmode/rb_trap_immediate/raised) */ |
| 9815 | | |
| 9816 | | NODE *node; |
| 9817 | | |
| 9818 | | int tracing; |
| 9819 | | VALUE errinfo; |
| 9820 | | VALUE last_status; |
| 9821 | | VALUE last_line; |
| 9822 | | VALUE last_match; |
| 9823 | | |
| 9824 | | int safe; |
| 9825 | | |
| 9826 | | enum thread_status status; |
| 9827 | | int wait_for; |
| 9828 | | int fd; |
| 9829 | | fd_set readfds; |
| 9830 | | fd_set writefds; |
| 9831 | | fd_set exceptfds; |
| 9832 | | int select_value; |
| 9833 | | double delay; |
| 9834 | | rb_thread_t join; |
| 9835 | | |
| 9836 | | int abort; |
| 9837 | | int priority; |
| 9838 | | VALUE thgroup; |
| 9839 | | |
| 9840 | | st_table *locals; |
| 9841 | | |
| 9842 | | VALUE thread; |
| 9843 | | }; |
| 9844 | | |
| 9845 | 9772 | #define THREAD_RAISED 0x200 /* temporary flag */ |
| 9846 | 9773 | #define THREAD_TERMINATING 0x400 /* persistent flag */ |
| 9847 | | #define THREAD_FLAGS_MASK 0x400 /* mask for persistent flags */ |
| | 9774 | #define THREAD_NO_ENSURE 0x800 /* persistent flag */ |
| | 9775 | #define THREAD_FLAGS_MASK 0xc00 /* mask for persistent flags */ |
| 9848 | 9776 | |
| 9849 | 9777 | #define FOREACH_THREAD_FROM(f,x) x = f; do { x = x->next; |
| 9850 | 9778 | #define END_FOREACH_FROM(f,x) } while (x != f) |
| … |
… |
|
| 9912 | 9840 | return 1; |
| 9913 | 9841 | } |
| 9914 | 9842 | |
| | 9843 | static int |
| | 9844 | thread_no_ensure() |
| | 9845 | { |
| | 9846 | return ((curr_thread->flags & THREAD_NO_ENSURE) == THREAD_NO_ENSURE); |
| | 9847 | } |
| | 9848 | |
| 9915 | 9849 | static void rb_thread_ready _((rb_thread_t)); |
| 9916 | 9850 | |
| 9917 | 9851 | static VALUE run_trap_eval _((VALUE)); |
| … |
… |
|
| 10042 | 9976 | rb_gc_mark(th->last_match); |
| 10043 | 9977 | rb_mark_tbl(th->locals); |
| 10044 | 9978 | rb_gc_mark(th->thgroup); |
| | 9979 | rb_gc_mark_maybe(th->sandbox); |
| 10045 | 9980 | |
| 10046 | 9981 | /* mark data in copied stack */ |
| 10047 | 9982 | if (th == curr_thread) return; |
| … |
… |
|
| 10246 | 10181 | th->safe = ruby_safe_level; |
| 10247 | 10182 | |
| 10248 | 10183 | th->node = ruby_current_node; |
| | 10184 | if (ruby_sandbox_save != NULL) |
| | 10185 | { |
| | 10186 | ruby_sandbox_save(th); |
| | 10187 | } |
| 10249 | 10188 | } |
| 10250 | 10189 | |
| 10251 | 10190 | static int |
| … |
… |
|
| 10336 | 10275 | #endif |
| 10337 | 10276 | |
| 10338 | 10277 | rb_trap_immediate = 0; /* inhibit interrupts from here */ |
| | 10278 | if (ruby_sandbox_restore != NULL) |
| | 10279 | { |
| | 10280 | ruby_sandbox_restore(th); |
| | 10281 | } |
| 10339 | 10282 | ruby_frame = th->frame; |
| 10340 | 10283 | ruby_scope = th->scope; |
| 10341 | 10284 | ruby_class = th->klass; |
| … |
… |
|
| 11201 | 11144 | } |
| 11202 | 11145 | |
| 11203 | 11146 | |
| | 11147 | static void |
| | 11148 | kill_thread(th, flags) |
| | 11149 | rb_thread_t th; |
| | 11150 | int flags; |
| | 11151 | { |
| | 11152 | if (th != curr_thread && th->safe < 4) { |
| | 11153 | rb_secure(4); |
| | 11154 | } |
| | 11155 | if (th->status == THREAD_TO_KILL || th->status == THREAD_KILLED) |
| | 11156 | return; |
| | 11157 | if (th == th->next || th == main_thread) rb_exit(EXIT_SUCCESS); |
| | 11158 | |
| | 11159 | rb_thread_ready(th); |
| | 11160 | th->flags |= flags; |
| | 11161 | th->status = THREAD_TO_KILL; |
| | 11162 | if (!rb_thread_critical) rb_thread_schedule(); |
| | 11163 | } |
| | 11164 | |
| | 11165 | |
| 11204 | 11166 | /* |
| 11205 | 11167 | * call-seq: |
| 11206 | | * thr.exit => thr or nil |
| 11207 | | * thr.kill => thr or nil |
| 11208 | | * thr.terminate => thr or nil |
| 11209 | | * |
| 11210 | | * Terminates <i>thr</i> and schedules another thread to be run. If this thread |
| 11211 | | * is already marked to be killed, <code>exit</code> returns the |
| 11212 | | * <code>Thread</code>. If this is the main thread, or the last thread, exits |
| 11213 | | * the process. |
| | 11168 | * thr.exit => thr |
| | 11169 | * thr.kill => thr |
| | 11170 | * thr.terminate => thr |
| | 11171 | * |
| | 11172 | * Terminates <i>thr</i> and schedules another thread to be run, returning |
| | 11173 | * the terminated <code>Thread</code>. If this is the main thread, or the |
| | 11174 | * last thread, exits the process. |
| 11214 | 11175 | */ |
| 11215 | 11176 | |
| 11216 | 11177 | VALUE |
| … |
… |
|
| 11219 | 11180 | { |
| 11220 | 11181 | rb_thread_t th = rb_thread_check(thread); |
| 11221 | 11182 | |
| 11222 | | if (th != curr_thread && th->safe < 4) { |
| 11223 | | rb_secure(4); |
| 11224 | | } |
| 11225 | | if (th->status == THREAD_TO_KILL || th->status == THREAD_KILLED) |
| | 11183 | kill_thread(th, 0); |
| 11226 | 11184 | return thread; |
| 11227 | | if (th == th->next || th == main_thread) rb_exit(EXIT_SUCCESS); |
| | 11185 | } |
| 11228 | 11186 | |
| 11229 | | rb_thread_ready(th); |
| 11230 | | th->status = THREAD_TO_KILL; |
| 11231 | | if (!rb_thread_critical) rb_thread_schedule(); |
| | 11187 | |
| | 11188 | /* |
| | 11189 | * call-seq: |
| | 11190 | * thr.exit! => thr |
| | 11191 | * thr.kill! => thr |
| | 11192 | * thr.terminate! => thr |
| | 11193 | * |
| | 11194 | * Terminates <i>thr</i> without calling ensure clauses and schedules |
| | 11195 | * another thread to be run, returning the terminated <code>Thread</code>. |
| | 11196 | * If this is the main thread, or the last thread, exits the process. |
| | 11197 | * |
| | 11198 | * See <code>Thread#exit</code> for the safer version. |
| | 11199 | */ |
| | 11200 | |
| | 11201 | static VALUE |
| | 11202 | rb_thread_kill_bang(thread) |
| | 11203 | VALUE thread; |
| | 11204 | { |
| | 11205 | rb_thread_t th = rb_thread_check(thread); |
| | 11206 | kill_thread(th, THREAD_NO_ENSURE); |
| 11232 | 11207 | return thread; |
| 11233 | 11208 | } |
| 11234 | 11209 | |
| 11235 | | |
| 11236 | 11210 | /* |
| 11237 | 11211 | * call-seq: |
| 11238 | 11212 | * Thread.kill(thread) => thread |
| … |
… |
|
| 11626 | 11600 | th->thgroup = thgroup_default;\ |
| 11627 | 11601 | th->locals = 0;\ |
| 11628 | 11602 | th->thread = 0;\ |
| | 11603 | if (curr_thread == 0) {\ |
| | 11604 | th->sandbox = Qnil;\ |
| | 11605 | } else {\ |
| | 11606 | th->sandbox = curr_thread->sandbox;\ |
| | 11607 | }\ |
| 11629 | 11608 | } while (0) |
| 11630 | 11609 | |
| 11631 | 11610 | static rb_thread_t |
| … |
… |
|
| 12883 | 12862 | rb_define_method(rb_cThread, "kill", rb_thread_kill, 0); |
| 12884 | 12863 | rb_define_method(rb_cThread, "terminate", rb_thread_kill, 0); |
| 12885 | 12864 | rb_define_method(rb_cThread, "exit", rb_thread_kill, 0); |
| | 12865 | rb_define_method(rb_cThread, "kill!", rb_thread_kill_bang, 0); |
| | 12866 | rb_define_method(rb_cThread, "terminate!", rb_thread_kill_bang, 0); |
| | 12867 | rb_define_method(rb_cThread, "exit!", rb_thread_kill_bang, 0); |
| 12886 | 12868 | rb_define_method(rb_cThread, "value", rb_thread_value, 0); |
| 12887 | 12869 | rb_define_method(rb_cThread, "status", rb_thread_status, 0); |
| 12888 | 12870 | rb_define_method(rb_cThread, "join", rb_thread_join_m, -1); |
diff -wur ruby-1.8.5/node.h ruby-1.8.5-sandbox/node.h
|
old
|
new
|
|
| 151 | 151 | } u3; |
| 152 | 152 | } NODE; |
| 153 | 153 | |
| | 154 | extern NODE *ruby_cref; |
| | 155 | extern NODE *ruby_top_cref; |
| | 156 | |
| 154 | 157 | #define RNODE(obj) (R_CAST(RNode)(obj)) |
| 155 | 158 | |
| 156 | 159 | #define nd_type(n) ((int)(((RNODE(n))->flags>>FL_USHIFT)&0xff)) |
| … |
… |
|
| 371 | 374 | void rb_add_event_hook _((rb_event_hook_func_t,rb_event_t)); |
| 372 | 375 | int rb_remove_event_hook _((rb_event_hook_func_t)); |
| 373 | 376 | |
| | 377 | #if defined(HAVE_GETCONTEXT) && defined(HAVE_SETCONTEXT) |
| | 378 | #include <ucontext.h> |
| | 379 | #define USE_CONTEXT |
| | 380 | #endif |
| | 381 | #include <setjmp.h> |
| | 382 | #include "st.h" |
| | 383 | |
| | 384 | #ifdef USE_CONTEXT |
| | 385 | typedef struct { |
| | 386 | ucontext_t context; |
| | 387 | volatile int status; |
| | 388 | } rb_jmpbuf_t[1]; |
| | 389 | #else |
| | 390 | typedef jmp_buf rb_jmpbuf_t; |
| | 391 | #endif |
| | 392 | |
| | 393 | enum thread_status { |
| | 394 | THREAD_TO_KILL, |
| | 395 | THREAD_RUNNABLE, |
| | 396 | THREAD_STOPPED, |
| | 397 | THREAD_KILLED, |
| | 398 | }; |
| | 399 | |
| | 400 | typedef struct thread * rb_thread_t; |
| | 401 | |
| | 402 | struct thread { |
| | 403 | struct thread *next, *prev; |
| | 404 | rb_jmpbuf_t context; |
| | 405 | #ifdef SAVE_WIN32_EXCEPTION_LIST |
| | 406 | DWORD win32_exception_list; |
| | 407 | #endif |
| | 408 | |
| | 409 | VALUE result; |
| | 410 | |
| | 411 | long stk_len; |
| | 412 | long stk_max; |
| | 413 | VALUE *stk_ptr; |
| | 414 | VALUE *stk_pos; |
| | 415 | #ifdef __ia64__ |
| | 416 | VALUE *bstr_ptr; |
| | 417 | long bstr_len; |
| | 418 | #endif |
| | 419 | |
| | 420 | struct FRAME *frame; |
| | 421 | struct SCOPE *scope; |
| | 422 | struct RVarmap *dyna_vars; |
| | 423 | struct BLOCK *block; |
| | 424 | struct iter *iter; |
| | 425 | struct tag *tag; |
| | 426 | VALUE klass; |
| | 427 | VALUE wrapper; |
| | 428 | NODE *cref; |
| | 429 | |
| | 430 | int flags; /* misc. states (vmode/rb_trap_immediate/raised) */ |
| | 431 | |
| | 432 | NODE *node; |
| | 433 | |
| | 434 | int tracing; |
| | 435 | VALUE errinfo; |
| | 436 | VALUE last_status; |
| | 437 | VALUE last_line; |
| | 438 | VALUE last_match; |
| | 439 | |
| | 440 | int safe; |
| | 441 | |
| | 442 | enum thread_status status; |
| | 443 | int wait_for; |
| | 444 | int fd; |
| | 445 | fd_set readfds; |
| | 446 | fd_set writefds; |
| | 447 | fd_set exceptfds; |
| | 448 | int select_value; |
| | 449 | double delay; |
| | 450 | rb_thread_t join; |
| | 451 | |
| | 452 | int abort; |
| | 453 | int priority; |
| | 454 | VALUE thgroup; |
| | 455 | |
| | 456 | st_table *locals; |
| | 457 | |
| | 458 | VALUE thread; |
| | 459 | |
| | 460 | VALUE sandbox; |
| | 461 | }; |
| | 462 | |
| | 463 | extern VALUE (*ruby_sandbox_save)(struct thread *); |
| | 464 | extern VALUE (*ruby_sandbox_restore)(struct thread *); |
| | 465 | extern rb_thread_t curr_thread; |
| | 466 | extern rb_thread_t main_thread; |
| | 467 | |
| 374 | 468 | #if defined(__cplusplus) |
| 375 | 469 | } /* extern "C" { */ |
| 376 | 470 | #endif |
diff -wur ruby-1.8.5/ruby.h ruby-1.8.5-sandbox/ruby.h
|
old
|
new
|
|
| 626 | 626 | RUBY_EXTERN VALUE rb_eRuntimeError; |
| 627 | 627 | RUBY_EXTERN VALUE rb_eSecurityError; |
| 628 | 628 | RUBY_EXTERN VALUE rb_eSystemCallError; |
| | 629 | RUBY_EXTERN VALUE rb_eThreadError; |
| 629 | 630 | RUBY_EXTERN VALUE rb_eTypeError; |
| 630 | 631 | RUBY_EXTERN VALUE rb_eZeroDivError; |
| 631 | 632 | RUBY_EXTERN VALUE rb_eNotImpError; |