ruby-changes:34213
From: nagachika <ko1@a...>
Date: Mon, 2 Jun 2014 09:26:50 +0900 (JST)
Subject: [ruby-changes:34213] nagachika:r46305 (ruby_2_1): merge revision(s) r45471: [Backport #9688]
nagachika 2014-06-02 02:21:10 +0900 (Mon, 02 Jun 2014) New Revision: 46305 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=46305 Log: merge revision(s) r45471: [Backport #9688] * win32/win32.c (rb_w32_accept, open_ifs_socket, socketpair_internal): reset inherit flag of socket to avoid unintentional inheritance of socket. note that the return value of SetHandleInformation() is not verified intentionally because old Windows may return an error. [Bug #9688] [ruby-core:61754] Modified directories: branches/ruby_2_1/ Modified files: branches/ruby_2_1/ChangeLog branches/ruby_2_1/version.h branches/ruby_2_1/win32/win32.c Index: ruby_2_1/ChangeLog =================================================================== --- ruby_2_1/ChangeLog (revision 46304) +++ ruby_2_1/ChangeLog (revision 46305) @@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ChangeLog#L1 +Mon Jun 2 02:19:30 2014 NAKAMURA Usaku <usa@r...> + + * win32/win32.c (rb_w32_accept, open_ifs_socket, socketpair_internal): + reset inherit flag of socket to avoid unintentional inheritance of + socket. note that the return value of SetHandleInformation() is not + verified intentionally because old Windows may return an error. + [Bug #9688] [ruby-core:61754] + Mon Jun 2 02:12:10 2014 Eric Wong <e@8...> * time.c (time_mload): freeze and preserve marshal-loaded time zone Index: ruby_2_1/win32/win32.c =================================================================== --- ruby_2_1/win32/win32.c (revision 46304) +++ ruby_2_1/win32/win32.c (revision 46305) @@ -3017,6 +3017,7 @@ rb_w32_accept(int s, struct sockaddr *ad https://github.com/ruby/ruby/blob/trunk/ruby_2_1/win32/win32.c#L3017 if (fd != -1) { r = accept(TO_SOCKET(s), addr, addrlen); if (r != INVALID_SOCKET) { + SetHandleInformation((HANDLE)r, HANDLE_FLAG_INHERIT, 0); MTHREAD_ONLY(EnterCriticalSection(&(_pioinfo(fd)->lock))); _set_osfhnd(fd, r); MTHREAD_ONLY(LeaveCriticalSection(&_pioinfo(fd)->lock)); @@ -3557,6 +3558,8 @@ open_ifs_socket(int af, int type, int pr https://github.com/ruby/ruby/blob/trunk/ruby_2_1/win32/win32.c#L3558 } if (out == INVALID_SOCKET) out = WSASocket(af, type, protocol, NULL, 0, 0); + if (out != INVALID_SOCKET) + SetHandleInformation((HANDLE)out, HANDLE_FLAG_INHERIT, 0); } free(proto_buffers); @@ -3790,6 +3793,7 @@ socketpair_internal(int af, int type, in https://github.com/ruby/ruby/blob/trunk/ruby_2_1/win32/win32.c#L3793 r = accept(svr, addr, &len); if (r == INVALID_SOCKET) break; + SetHandleInformation((HANDLE)r, HANDLE_FLAG_INHERIT, 0); ret = 0; } while (0); Index: ruby_2_1/version.h =================================================================== --- ruby_2_1/version.h (revision 46304) +++ ruby_2_1/version.h (revision 46305) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/version.h#L1 #define RUBY_VERSION "2.1.2" #define RUBY_RELEASE_DATE "2014-06-02" -#define RUBY_PATCHLEVEL 121 +#define RUBY_PATCHLEVEL 122 #define RUBY_RELEASE_YEAR 2014 #define RUBY_RELEASE_MONTH 6 Property changes on: ruby_2_1 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r45471 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/