summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Legler <a3li@gentoo.org>2010-08-21 13:36:02 +0200
committerAlex Legler <a3li@gentoo.org>2010-08-21 13:36:02 +0200
commit770f741f2870e6ad60c2ec54f14f3eff576defa7 (patch)
tree7aaf7fc93d65589183a54d31575e802f3a30e6c4 /patchsets
parentAdd another patch to make sure that gems are not installed with Ruby 1.9. (diff)
downloadruby-scripts-770f741f2870e6ad60c2ec54f14f3eff576defa7.tar.gz
ruby-scripts-770f741f2870e6ad60c2ec54f14f3eff576defa7.tar.bz2
ruby-scripts-770f741f2870e6ad60c2ec54f14f3eff576defa7.zip
Add 1.8.6-p399 patchsetpatches-1.8.6_p399
Diffstat (limited to 'patchsets')
-rw-r--r--patchsets/distfiles/ruby-patches-1.8.6_p399.tar.bz2bin0 -> 3782 bytes
-rw-r--r--patchsets/patches-1.8.6_p399/001_memory_leak.patch59
-rw-r--r--patchsets/patches-1.8.6_p399/002_mkconfig.patch16
-rw-r--r--patchsets/patches-1.8.6_p399/003_mkmf-parallel-install.patch16
-rw-r--r--patchsets/patches-1.8.6_p399/006_configure_pthread.patch26
-rw-r--r--patchsets/patches-1.8.6_p399/007_configure-uclibc-udp.patch22
-rw-r--r--patchsets/patches-1.8.6_p399/008_eval_fix_segfault.patch94
-rw-r--r--patchsets/patches-1.8.6_p399/009_berkdb-5.0.patch13
-rw-r--r--patchsets/patches-1.8.6_p399/010_no-undefined-ext.patch13
-rw-r--r--patchsets/patches-1.8.6_p399/012_webrick-CVE-2010-0541.patch15
-rw-r--r--patchsets/patches-1.8.6_p399/series9
11 files changed, 283 insertions, 0 deletions
diff --git a/patchsets/distfiles/ruby-patches-1.8.6_p399.tar.bz2 b/patchsets/distfiles/ruby-patches-1.8.6_p399.tar.bz2
new file mode 100644
index 0000000..efd9d7f
--- /dev/null
+++ b/patchsets/distfiles/ruby-patches-1.8.6_p399.tar.bz2
Binary files differ
diff --git a/patchsets/patches-1.8.6_p399/001_memory_leak.patch b/patchsets/patches-1.8.6_p399/001_memory_leak.patch
new file mode 100644
index 0000000..583eb79
--- /dev/null
+++ b/patchsets/patches-1.8.6_p399/001_memory_leak.patch
@@ -0,0 +1,59 @@
+Index: ruby-1.8.6-p388/ext/dl/handle.c
+===================================================================
+--- ruby-1.8.6-p388.orig/ext/dl/handle.c
++++ ruby-1.8.6-p388/ext/dl/handle.c
+@@ -10,9 +10,12 @@ VALUE rb_cDLHandle;
+ void
+ dlhandle_free(struct dl_handle *dlhandle)
+ {
++ if (!dlhandle)
++ return;
+ if (dlhandle->ptr && dlhandle->open && dlhandle->enable_close) {
+ dlclose(dlhandle->ptr);
+ }
++ dlfree(dlhandle);
+ }
+
+ VALUE
+Index: ruby-1.8.6-p388/ext/dl/ptr.c
+===================================================================
+--- ruby-1.8.6-p388.orig/ext/dl/ptr.c
++++ ruby-1.8.6-p388/ext/dl/ptr.c
+@@ -45,6 +45,8 @@ rb_dlmem_aref(void *ptr)
+ void
+ dlptr_free(struct ptr_data *data)
+ {
++ if (!data)
++ return;
+ if (data->ptr) {
+ DEBUG_CODE({
+ printf("dlptr_free(): removing the pointer `0x%x' from the MemorySpace\n",
+@@ -61,6 +63,7 @@ dlptr_free(struct ptr_data *data)
+ if (data->stype) dlfree(data->stype);
+ if (data->ssize) dlfree(data->ssize);
+ if (data->ids) dlfree(data->ids);
++ dlfree(data);
+ }
+
+ void
+Index: ruby-1.8.6-p388/ext/dl/sym.c
+===================================================================
+--- ruby-1.8.6-p388.orig/ext/dl/sym.c
++++ ruby-1.8.6-p388/ext/dl/sym.c
+@@ -57,6 +57,8 @@ char2type(int ch)
+ void
+ dlsym_free(struct sym_data *data)
+ {
++ if(!data)
++ return;
+ if( data->name ){
+ DEBUG_CODE({
+ printf("dlsym_free(): free(data->name:%s)\n",data->name);
+@@ -69,6 +71,7 @@ dlsym_free(struct sym_data *data)
+ });
+ free(data->type);
+ }
++ dlfree(data);
+ }
+
+ VALUE
diff --git a/patchsets/patches-1.8.6_p399/002_mkconfig.patch b/patchsets/patches-1.8.6_p399/002_mkconfig.patch
new file mode 100644
index 0000000..dc18561
--- /dev/null
+++ b/patchsets/patches-1.8.6_p399/002_mkconfig.patch
@@ -0,0 +1,16 @@
+Fix for mkconfig to be able to handle empty continued lines.
+Patch from [ruby-core:20420] via bug 234877.
+
+Index: ruby-1.8.6-p388/mkconfig.rb
+===================================================================
+--- ruby-1.8.6-p388.orig/mkconfig.rb
++++ ruby-1.8.6-p388/mkconfig.rb
+@@ -54,7 +54,7 @@ File.foreach "config.status" do |line|
+ continued_name = name
+ next
+ end
+- when /^"(.+)"\s*(\\)?$/
++ when /^"(.*)"\s*(\\)?$/
+ if continued_line
+ continued_line << $1
+ unless $2
diff --git a/patchsets/patches-1.8.6_p399/003_mkmf-parallel-install.patch b/patchsets/patches-1.8.6_p399/003_mkmf-parallel-install.patch
new file mode 100644
index 0000000..0391239
--- /dev/null
+++ b/patchsets/patches-1.8.6_p399/003_mkmf-parallel-install.patch
@@ -0,0 +1,16 @@
+ Patch for bug 239101 by Matsuu Takuto, via Redmine issue 1337 (yes, really).
+ Backported for 1.8.* by Alex Legler.
+
+Index: ruby-1.8.6-p388/lib/mkmf.rb
+===================================================================
+--- ruby-1.8.6-p388.orig/lib/mkmf.rb
++++ ruby-1.8.6-p388/lib/mkmf.rb
+@@ -1278,7 +1278,7 @@ static: $(STATIC_LIB)#{$extout ? " inst
+ dest = "#{dir}/#{f}"
+ mfile.print "install-so: #{dest}\n"
+ unless $extout
+- mfile.print "#{dest}: #{f}\n"
++ mfile.print "#{dest}: #{dir} #{f}\n"
+ if (sep = config_string('BUILD_FILE_SEPARATOR'))
+ f.gsub!("/", sep)
+ dir.gsub!("/", sep)
diff --git a/patchsets/patches-1.8.6_p399/006_configure_pthread.patch b/patchsets/patches-1.8.6_p399/006_configure_pthread.patch
new file mode 100644
index 0000000..d3af1ca
--- /dev/null
+++ b/patchsets/patches-1.8.6_p399/006_configure_pthread.patch
@@ -0,0 +1,26 @@
+Fix configure.in to only check for pthread when --enable-pthread is supplied.
+
+Via: http://permalink.gmane.org/gmane.comp.lang.ruby.general/301085
+Upstream: yes
+
+Index: ruby-1.8.6-p388/configure.in
+===================================================================
+--- ruby-1.8.6-p388.orig/configure.in
++++ ruby-1.8.6-p388/configure.in
+@@ -488,7 +488,7 @@ AC_HEADER_SYS_WAIT
+ AC_CHECK_HEADERS(stdlib.h string.h unistd.h limits.h sys/file.h sys/ioctl.h sys/syscall.h\
+ fcntl.h sys/fcntl.h sys/select.h sys/time.h sys/times.h sys/param.h\
+ syscall.h pwd.h grp.h a.out.h utime.h memory.h direct.h sys/resource.h \
+- sys/mkdev.h sys/utime.h netinet/in_systm.h float.h ieeefp.h pthread.h \
++ sys/mkdev.h sys/utime.h netinet/in_systm.h float.h ieeefp.h \
+ ucontext.h intrinsics.h)
+
+ dnl Check additional types.
+@@ -921,6 +921,7 @@ int main()
+ AC_DEFINE_UNQUOTED(STACK_GROW_DIRECTION, $rb_cv_stack_grow_dir)
+
+ if test x"$enable_pthread" = xyes; then
++ AC_CHECK_HEADERS([pthread.h])
+ for pthread_lib in pthread pthreads c c_r; do
+ AC_CHECK_LIB($pthread_lib, pthread_kill,
+ rb_with_pthread=yes, rb_with_pthread=no)
diff --git a/patchsets/patches-1.8.6_p399/007_configure-uclibc-udp.patch b/patchsets/patches-1.8.6_p399/007_configure-uclibc-udp.patch
new file mode 100644
index 0000000..a6d4ea0
--- /dev/null
+++ b/patchsets/patches-1.8.6_p399/007_configure-uclibc-udp.patch
@@ -0,0 +1,22 @@
+Patch for bug 260760. Fixes UDP sockets on uClibc systems.
+
+Index: ruby-1.8.6-p388/configure.in
+===================================================================
+--- ruby-1.8.6-p388.orig/configure.in
++++ ruby-1.8.6-p388/configure.in
+@@ -769,6 +769,7 @@ AC_CACHE_VAL(rb_cv_frptr,
+ __ptr dnl
+ bufpos dnl
+ _p dnl
++ __bufpos dnl
+ ; do
+ AC_TRY_COMPILE([#include <stdio.h>
+ ],
+@@ -788,6 +789,7 @@ else
+ [for frend in dnl
+ _IO_read_end dnl
+ bufread dnl
++ __bufread dnl
+ ; do
+ AC_TRY_COMPILE([#include <stdio.h>
+ ],
diff --git a/patchsets/patches-1.8.6_p399/008_eval_fix_segfault.patch b/patchsets/patches-1.8.6_p399/008_eval_fix_segfault.patch
new file mode 100644
index 0000000..4a617a9
--- /dev/null
+++ b/patchsets/patches-1.8.6_p399/008_eval_fix_segfault.patch
@@ -0,0 +1,94 @@
+Fix segfault when running code like "p eval('0'+'+0.1'*5133)" (causing a stack overflow)
+This at least makes ruby thow a SystemStackError instead of segfaulting.
+http://redmine.ruby-lang.org/issues/show/1329
+
+Upstream: yes (applied in 1.8.8)
+Backported for 1.8.6 by a3li@gentoo.org.
+
+Index: ruby-1.8.6-p388/eval.c
+===================================================================
+--- ruby-1.8.6-p388.orig/eval.c
++++ ruby-1.8.6-p388/eval.c
+@@ -236,6 +236,7 @@ static VALUE rb_f_binding _((VALUE));
+ static void rb_f_END _((void));
+ static VALUE rb_f_block_given_p _((void));
+ static VALUE block_pass _((VALUE,NODE*));
++static void eval_check_tick _((void));
+
+ VALUE rb_cMethod;
+ static VALUE method_call _((int, VALUE*, VALUE));
+@@ -2963,6 +2964,7 @@ rb_eval(self, n)
+ goto finish; \
+ } while (0)
+
++ eval_check_tick();
+ again:
+ if (!node) RETURN(Qnil);
+
+@@ -5576,6 +5578,17 @@ stack_check()
+ }
+ }
+
++static void
++eval_check_tick()
++{
++ static int tick;
++ if ((++tick & 0xff) == 0) {
++ CHECK_INTS; /* better than nothing */
++ stack_check();
++ rb_gc_finalize_deferred();
++ }
++}
++
+ static int last_call_status;
+
+ #define CSTAT_PRIV 1
+@@ -5807,7 +5820,6 @@ rb_call0(klass, recv, id, oid, argc, arg
+ NODE *b2; /* OK */
+ volatile VALUE result = Qnil;
+ int itr;
+- static int tick;
+ TMP_PROTECT;
+ volatile int safe = -1;
+
+@@ -5826,11 +5838,7 @@ rb_call0(klass, recv, id, oid, argc, arg
+ break;
+ }
+
+- if ((++tick & 0xff) == 0) {
+- CHECK_INTS; /* better than nothing */
+- stack_check();
+- rb_gc_finalize_deferred();
+- }
++ eval_check_tick();
+ if (argc < 0) {
+ VALUE tmp;
+ VALUE *nargv;
+@@ -6559,15 +6567,23 @@ eval(self, src, scope, file, line)
+ if (state == TAG_RAISE) {
+ if (strcmp(file, "(eval)") == 0) {
+ VALUE mesg, errat, bt2;
++ ID id_mesg;
+
++ id_mesg = rb_intern("mesg");
+ errat = get_backtrace(ruby_errinfo);
+- mesg = rb_attr_get(ruby_errinfo, rb_intern("mesg"));
++ mesg = rb_attr_get(ruby_errinfo, id_mesg);
+ if (!NIL_P(errat) && TYPE(errat) == T_ARRAY &&
+ (bt2 = backtrace(-2), RARRAY(bt2)->len > 0)) {
+ if (!NIL_P(mesg) && TYPE(mesg) == T_STRING) {
+- rb_str_update(mesg, 0, 0, rb_str_new2(": "));
+- rb_str_update(mesg, 0, 0, RARRAY(errat)->ptr[0]);
+- }
++ if (OBJ_FROZEN(mesg)) {
++ VALUE m = rb_str_cat(rb_str_dup(RARRAY(errat)->ptr[0]), ": ", 2);
++ rb_ivar_set(ruby_errinfo, id_mesg, rb_str_append(m, mesg));
++ }
++ else {
++ rb_str_update(mesg, 0, 0, rb_str_new2(": "));
++ rb_str_update(mesg, 0, 0, RARRAY(errat)->ptr[0]);
++ }
++ }
+ RARRAY(errat)->ptr[0] = RARRAY(bt2)->ptr[0];
+ }
+ }
diff --git a/patchsets/patches-1.8.6_p399/009_berkdb-5.0.patch b/patchsets/patches-1.8.6_p399/009_berkdb-5.0.patch
new file mode 100644
index 0000000..096a1bf
--- /dev/null
+++ b/patchsets/patches-1.8.6_p399/009_berkdb-5.0.patch
@@ -0,0 +1,13 @@
+Index: ruby-1.8.7-p249/ext/dbm/extconf.rb
+===================================================================
+--- ruby-1.8.7-p249.orig/ext/dbm/extconf.rb
++++ ruby-1.8.7-p249/ext/dbm/extconf.rb
+@@ -26,7 +26,7 @@ def headers.db_check(db)
+ case db
+ when /^db2?$/
+ db_prefix = "__db_n"
+- hsearch = "-DDB_DBM_HSEARCH "
++ hsearch = "-DDB_DBM_HSEARCH -DHAVE_DBM "
+ when "gdbm"
+ have_gdbm = true
+ when "gdbm_compat"
diff --git a/patchsets/patches-1.8.6_p399/010_no-undefined-ext.patch b/patchsets/patches-1.8.6_p399/010_no-undefined-ext.patch
new file mode 100644
index 0000000..ffebd06
--- /dev/null
+++ b/patchsets/patches-1.8.6_p399/010_no-undefined-ext.patch
@@ -0,0 +1,13 @@
+Index: ruby-1.8.6-p388/configure.in
+===================================================================
+--- ruby-1.8.6-p388.orig/configure.in
++++ ruby-1.8.6-p388/configure.in
+@@ -1088,7 +1088,7 @@ if test "$with_dln_a_out" != yes; then
+ linux* | gnu* | k*bsd*-gnu | netbsd* | bsdi*)
+ : ${LDSHARED='${CC} -shared'}
+ if test "$rb_cv_binary_elf" = yes; then
+- LDFLAGS="$LDFLAGS -Wl,-export-dynamic"
++ LDFLAGS="$LDFLAGS -Wl,-export-dynamic -Wl,--no-undefined"
+ fi
+ rb_cv_dlopen=yes ;;
+ interix*) : ${LDSHARED="$CC -shared"}
diff --git a/patchsets/patches-1.8.6_p399/012_webrick-CVE-2010-0541.patch b/patchsets/patches-1.8.6_p399/012_webrick-CVE-2010-0541.patch
new file mode 100644
index 0000000..5ae9cba
--- /dev/null
+++ b/patchsets/patches-1.8.6_p399/012_webrick-CVE-2010-0541.patch
@@ -0,0 +1,15 @@
+Patch for CVE-2010-0541
+
+Index: httpresponse.rb
+===================================================================
+--- lib/webrick/httpresponse.rb (revision 28759)
++++ lib/webrick/httpresponse.rb (working copy)
+@@ -208,7 +208,7 @@
+ @keep_alive = false
+ self.status = HTTPStatus::RC_INTERNAL_SERVER_ERROR
+ end
+- @header['content-type'] = "text/html"
++ @header['content-type'] = "text/html; charset=ISO-8859-1"
+
+ if respond_to?(:create_error_page)
+ create_error_page()
diff --git a/patchsets/patches-1.8.6_p399/series b/patchsets/patches-1.8.6_p399/series
new file mode 100644
index 0000000..0106888
--- /dev/null
+++ b/patchsets/patches-1.8.6_p399/series
@@ -0,0 +1,9 @@
+001_memory_leak.patch
+003_mkmf-parallel-install.patch
+002_mkconfig.patch
+007_configure-uclibc-udp.patch
+006_configure_pthread.patch
+008_eval_fix_segfault.patch
+010_no-undefined-ext.patch
+009_berkdb-5.0.patch
+012_webrick-CVE-2010-0541.patch