ruby-changes:10585
From: akr <ko1@a...>
Date: Mon, 9 Feb 2009 01:27:47 +0900 (JST)
Subject: [ruby-changes:10585] Ruby:r22141 (ruby_1_8): * ext/socket/socket.c (unix_recv_io): relax msg_controllen error
akr 2009-02-09 01:27:39 +0900 (Mon, 09 Feb 2009) New Revision: 22141 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=22141 Log: * ext/socket/socket.c (unix_recv_io): relax msg_controllen error check for x86_64-openbsd4.4. Modified files: branches/ruby_1_8/ChangeLog branches/ruby_1_8/ext/socket/socket.c Index: ruby_1_8/ext/socket/socket.c =================================================================== --- ruby_1_8/ext/socket/socket.c (revision 22140) +++ ruby_1_8/ext/socket/socket.c (revision 22141) @@ -2097,11 +2097,16 @@ rb_sys_fail("recvmsg(2)"); #if FD_PASSING_BY_MSG_CONTROL - if (msg.msg_controllen != CMSG_SPACE(sizeof(int))) { - rb_raise(rb_eSocket, - "file descriptor was not passed (msg_controllen=%d, %d expected)", - msg.msg_controllen, CMSG_SPACE(sizeof(int))); + if (msg.msg_controllen < CMSG_LEN(sizeof(int))) { + rb_raise(rb_eSocket, + "file descriptor was not passed (msg_controllen=%d smaller than CMSG_LEN(sizeof(int))=%d)", + (int)msg.msg_controllen, (int)CMSG_LEN(sizeof(int))); } + if (CMSG_SPACE(sizeof(int)) < msg.msg_controllen) { + rb_raise(rb_eSocket, + "file descriptor was not passed (msg_controllen=%d bigger than CMSG_SPACE(sizeof(int))=%d)", + (int)msg.msg_controllen, (int)CMSG_SPACE(sizeof(int))); + } if (cmsg.hdr.cmsg_len != CMSG_LEN(sizeof(int))) { rb_raise(rb_eSocket, "file descriptor was not passed (cmsg_len=%d, %d expected)", Index: ruby_1_8/ChangeLog =================================================================== --- ruby_1_8/ChangeLog (revision 22140) +++ ruby_1_8/ChangeLog (revision 22141) @@ -1,3 +1,8 @@ +Mon Feb 9 01:21:16 2009 Tanaka Akira <akr@f...> + + * ext/socket/socket.c (unix_recv_io): relax msg_controllen error + check for x86_64-openbsd4.4. + Thu Feb 5 21:01:24 2009 Nobuyoshi Nakada <nobu@r...> * configure.in (darwin): get rid of strange settings issue of -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/