Ticket #6: 904_why_sandbox.patch

File 904_why_sandbox.patch, 2.3 kB (added by jontec, 10 months ago)

jontec's updated patch for sandbox on debian

  • ruby-1.8.5

    diff -wur ruby-1.8.5.orig/error.c ruby-1.8.5/error.c
    old new  
    827827 *     Errno.constants   #=> E2BIG, EACCES, EADDRINUSE, EADDRNOTAVAIL, ... 
    828828 */ 
    829829 
    830 static st_table *syserr_tbl; 
     830st_table *rb_syserr_tbl; 
    831831 
    832832static VALUE 
    833833set_syserr(n, name) 
     
    836836 { 
    837837    VALUE error; 
    838838 
    839     if (!st_lookup(syserr_tbl, n, &error)) { 
     839    if (!st_lookup(rb_syserr_tbl, n, &error)) { 
    840840        error = rb_define_class_under(rb_mErrno, name, rb_eSystemCallError); 
    841841        rb_define_const(error, "Errno", INT2NUM(n)); 
    842         st_add_direct(syserr_tbl, n, error); 
     842        st_add_direct(rb_syserr_tbl, n, error); 
    843843    } 
    844844    else { 
    845845        rb_define_const(rb_mErrno, name, error); 
     
    853853{ 
    854854    VALUE error; 
    855855 
    856     if (!st_lookup(syserr_tbl, n, &error)) { 
     856    if (!st_lookup(rb_syserr_tbl, n, &error)) { 
    857857        char name[8];   /* some Windows' errno have 5 digits. */ 
    858858 
    859859        snprintf(name, sizeof(name), "E%03d", n); 
     
    891891        if (argc == 1 && FIXNUM_P(mesg)) { 
    892892            error = mesg; mesg = Qnil; 
    893893        } 
    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)) { 
    895895            /* change class */ 
    896896            if (TYPE(self) != T_OBJECT) { /* insurance to avoid type crash */ 
    897897                rb_raise(rb_eTypeError, "invalid instance type"); 
     
    10311031    rb_eSecurityError = rb_define_class("SecurityError", rb_eStandardError); 
    10321032    rb_eNoMemError = rb_define_class("NoMemoryError", rb_eException); 
    10331033 
    1034     syserr_tbl = st_init_numtable(); 
     1034    rb_syserr_tbl = st_init_numtable(); 
    10351035    rb_eSystemCallError = rb_define_class("SystemCallError", rb_eStandardError); 
    10361036    rb_define_method(rb_eSystemCallError, "initialize", syserr_initialize, -1); 
    10371037    rb_define_method(rb_eSystemCallError, "errno", syserr_errno, 0); 
  • ruby-1.8.5

    diff -wur ruby-1.8.5.orig/eval.c ruby-1.8.5/eval.c
    old new  
    97719762# endif 
    97729763#endif 
    97739764 
    9774 /* typedef struct thread * rb_thread_t; */ 
    9775  
    97769765#define THREAD_RAISED 0x200      /* temporary flag */ 
    97779766#define THREAD_TERMINATING 0x400 /* persistent flag */ 
    97789767#define THREAD_NO_ENSURE 0x800   /* persistent flag */