[前][次][番号順一覧][スレッド一覧]

ruby-changes:36656

From: ktsj <ko1@a...>
Date: Sun, 7 Dec 2014 19:40:40 +0900 (JST)
Subject: [ruby-changes:36656] ktsj:r48737 (trunk): * ext/socket/basicsocket.c, ext/socket/sockssocket.c:

ktsj	2014-12-07 19:40:27 +0900 (Sun, 07 Dec 2014)

  New Revision: 48737

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=48737

  Log:
    * ext/socket/basicsocket.c, ext/socket/sockssocket.c:
      remove code for $SAFE=4.

  Modified files:
    trunk/ChangeLog
    trunk/ext/socket/basicsocket.c
    trunk/ext/socket/sockssocket.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 48736)
+++ ChangeLog	(revision 48737)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Dec  7 19:36:12 2014  Kazuki Tsujimoto  <kazuki@c...>
+
+	* ext/socket/basicsocket.c, ext/socket/sockssocket.c:
+	  remove code for $SAFE=4.
+
 Sun Dec  7 10:20:55 2014  Eric Hodel  <drbrain@s...>
 
 	* lib/rdoc:  Update to RDoc 4.2.0.
Index: ext/socket/basicsocket.c
===================================================================
--- ext/socket/basicsocket.c	(revision 48736)
+++ ext/socket/basicsocket.c	(revision 48737)
@@ -66,9 +66,6 @@ bsock_shutdown(int argc, VALUE *argv, VA https://github.com/ruby/ruby/blob/trunk/ext/socket/basicsocket.c#L66
     int how;
     rb_io_t *fptr;
 
-    if (rb_safe_level() >= 4 && !OBJ_TAINTED(sock)) {
-	rb_raise(rb_eSecurityError, "Insecure: can't shutdown socket");
-    }
     rb_scan_args(argc, argv, "01", &howto);
     if (howto == Qnil)
 	how = SHUT_RDWR;
@@ -100,9 +97,6 @@ bsock_close_read(VALUE sock) https://github.com/ruby/ruby/blob/trunk/ext/socket/basicsocket.c#L97
 {
     rb_io_t *fptr;
 
-    if (rb_safe_level() >= 4 && !OBJ_TAINTED(sock)) {
-	rb_raise(rb_eSecurityError, "Insecure: can't close socket");
-    }
     GetOpenFile(sock, fptr);
     shutdown(fptr->fd, 0);
     if (!(fptr->mode & FMODE_WRITABLE)) {
@@ -133,9 +127,6 @@ bsock_close_write(VALUE sock) https://github.com/ruby/ruby/blob/trunk/ext/socket/basicsocket.c#L127
 {
     rb_io_t *fptr;
 
-    if (rb_safe_level() >= 4 && !OBJ_TAINTED(sock)) {
-	rb_raise(rb_eSecurityError, "Insecure: can't close socket");
-    }
     GetOpenFile(sock, fptr);
     if (!(fptr->mode & FMODE_READABLE)) {
 	return rb_io_close(sock);
Index: ext/socket/sockssocket.c
===================================================================
--- ext/socket/sockssocket.c	(revision 48736)
+++ ext/socket/sockssocket.c	(revision 48737)
@@ -41,9 +41,6 @@ socks_s_close(VALUE sock) https://github.com/ruby/ruby/blob/trunk/ext/socket/sockssocket.c#L41
 {
     rb_io_t *fptr;
 
-    if (rb_safe_level() >= 4 && !OBJ_TAINTED(sock)) {
-	rb_raise(rb_eSecurityError, "Insecure: can't close socket");
-    }
     GetOpenFile(sock, fptr);
     shutdown(fptr->fd, 2);
     return rb_io_close(sock);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]