diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-11 07:18:29 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-11 07:18:29 +0000 |
commit | 4532c0d81ef7aeb6d75d7bbe099682ef90165e29 (patch) | |
tree | 3e89eb7dd7f57f4b835420f818421d31cd75a957 /win32 | |
parent | e9db21d9cf4067ec8c0da8d4a32e675b166f37d8 (diff) | |
download | ruby-4532c0d81ef7aeb6d75d7bbe099682ef90165e29.tar.gz |
* win32/win32.c (rb_w32_accept, rb_w32_socket, rb_w32_socketpair):
prohibit inheritance of sockets, too. [experimental]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r-- | win32/win32.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/win32/win32.c b/win32/win32.c index f49174de58..d3ba3fa07b 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -2269,7 +2269,7 @@ rb_w32_accept(int s, struct sockaddr *addr, int *addrlen) s = -1; } else { - s = rb_w32_open_osfhandle(r, O_RDWR|O_BINARY); + s = rb_w32_open_osfhandle(r, O_RDWR|O_BINARY|O_NOINHERIT); } }); return s; @@ -2568,7 +2568,7 @@ rb_w32_socket(int af, int type, int protocol) fd = -1; } else { - fd = rb_w32_open_osfhandle(s, O_RDWR|O_BINARY); + fd = rb_w32_open_osfhandle(s, O_RDWR|O_BINARY|O_NOINHERIT); } }); return fd; @@ -2788,8 +2788,8 @@ rb_w32_socketpair(int af, int type, int protocol, int *sv) if (socketpair_internal(af, type, protocol, pair) < 0) return -1; - sv[0] = rb_w32_open_osfhandle(pair[0], O_RDWR|O_BINARY); - sv[1] = rb_w32_open_osfhandle(pair[1], O_RDWR|O_BINARY); + sv[0] = rb_w32_open_osfhandle(pair[0], O_RDWR|O_BINARY|O_NOINHERIT); + sv[1] = rb_w32_open_osfhandle(pair[1], O_RDWR|O_BINARY|O_NOINHERIT); return 0; } |