diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-28 09:29:26 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-28 09:29:26 +0000 |
commit | 2ba6eec1fa50cacaff647525358fd93c7c862a27 (patch) | |
tree | e378059c80a7e05837ce341f7bccc2178a978356 /ext/socket | |
parent | 8746e342bc3b45ec7d14df09d1288a9b53f225f0 (diff) | |
download | ruby-2ba6eec1fa50cacaff647525358fd93c7c862a27.tar.gz |
* ext/socket/ancdata.c (ancillary_unix_rights): check message type.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket')
-rw-r--r-- | ext/socket/ancdata.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/socket/ancdata.c b/ext/socket/ancdata.c index 204f745314..9d1ab95c1f 100644 --- a/ext/socket/ancdata.c +++ b/ext/socket/ancdata.c @@ -254,6 +254,14 @@ static VALUE ancillary_unix_rights(VALUE self) { #ifdef SCM_RIGHTS + int level, type; + + level = ancillary_level(self); + type = ancillary_type(self); + + if (level != SOL_SOCKET || type != SCM_RIGHTS) + rb_raise(rb_eTypeError, "SCM_RIGHTS ancillary data expected"); + VALUE v = rb_attr_get(self, rb_intern("unix_rights")); return v; #else |