Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

merge revision(s) 31655:

?\012
	* eval.c (rb_thread_atfork): When a ruby process forks, its random
	  seed shall be reinitialized to prevent CVE-2003-0900 situation.
	  This bug affects for 1.8 and earlier series, but not for 1.9.
	  fixed [ruby-core:34944].

	* io.c (pipe_open): ditto.

	* random.c (rb_reset_random_seed): ditto.

	* intern.h (rb_reset_random_seed): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@31655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Signed-off-by: URABE, Shyouhei <shyouhei@ruby-lang.org>

git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8_7@31713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
commit 17bff4ceece27b946d4e6d8d824b7b23ebf1b9c9 1 parent ad71472
@shyouhei shyouhei authored
View
13 ChangeLog
@@ -1,3 +1,16 @@
+Sat May 21 05:43:03 2011 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * eval.c (rb_thread_atfork): When a ruby process forks, its random
+ seed shall be reinitialized to prevent CVE-2003-0900 situation.
+ This bug affects for 1.8 and earlier series, but not for 1.9.
+ fixed [ruby-core:34944].
+
+ * io.c (pipe_open): ditto.
+
+ * random.c (rb_reset_random_seed): ditto.
+
+ * intern.h (rb_reset_random_seed): ditto.
+
Sat May 21 04:55:15 2011 Akinori MUSHA <knu@iDaemons.org>
* lib/uri/generic.rb (#route_from_path): Fix a bug where
View
1  eval.c
@@ -13178,6 +13178,7 @@ rb_thread_atfork()
{
rb_thread_t th;
+ rb_reset_random_seed();
if (rb_thread_alone()) return;
FOREACH_THREAD(th) {
if (th != curr_thread) {
View
1  intern.h
@@ -380,6 +380,7 @@ VALUE rb_length_by_each _((VALUE));
/* random.c */
unsigned long rb_genrand_int32(void);
double rb_genrand_real(void);
+void rb_reset_random_seed(void);
/* re.c */
int rb_memcmp _((const void*,const void*,long));
int rb_memcicmp _((const void*,const void*,long));
View
1  io.c
@@ -3254,6 +3254,7 @@ pipe_open(pstr, pname, mode)
rb_thread_stop_timer();
switch ((pid = fork())) {
case 0: /* child */
+ rb_thread_atfork();
if (modef & FMODE_READABLE) {
close(pr[0]);
if (pr[1] != 1) {
View
8 random.c
@@ -491,9 +491,15 @@ rb_f_rand(argc, argv, obj)
}
void
-Init_Random()
+rb_reset_random_seed()
{
rand_init(random_seed());
+}
+
+void
+Init_Random()
+{
+ rb_reset_random_seed();
rb_define_global_function("srand", rb_f_srand, -1);
rb_define_global_function("rand", rb_f_rand, -1);
rb_global_variable(&saved_seed);
View
8 version.h
@@ -1,15 +1,15 @@
#define RUBY_VERSION "1.8.7"
-#define RUBY_RELEASE_DATE "2011-05-21"
+#define RUBY_RELEASE_DATE "2011-05-23"
#define RUBY_VERSION_CODE 187
-#define RUBY_RELEASE_CODE 20110521
-#define RUBY_PATCHLEVEL 344
+#define RUBY_RELEASE_CODE 20110523
+#define RUBY_PATCHLEVEL 345
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8
#define RUBY_VERSION_TEENY 7
#define RUBY_RELEASE_YEAR 2011
#define RUBY_RELEASE_MONTH 5
-#define RUBY_RELEASE_DAY 21
+#define RUBY_RELEASE_DAY 23
#ifdef RUBY_EXTERN
RUBY_EXTERN const char ruby_version[];
Please sign in to comment.
Something went wrong with that request. Please try again.