summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-23 16:44:41 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-23 16:44:41 +0000
commit9d919ae7bf4279b0ad25ff9622ff929849a3d3ba (patch)
tree3fd67023dfc8cecb15e125ca0367c196087d976c /test
parent82e58ca5334997340ead069ec193fe0e44b2f972 (diff)
downloadruby-9d919ae7bf4279b0ad25ff9622ff929849a3d3ba.tar.gz
ruby-9d919ae7bf4279b0ad25ff9622ff929849a3d3ba.tar.xz
ruby-9d919ae7bf4279b0ad25ff9622ff929849a3d3ba.zip
* ext/ext/dl/handle.c (rb_dlhandle_initialize) added rb_secure(2)
[ruby-core:25762] * ext/dl/dl.c (rb_dl_dlopen) removed rb_secure(2) git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/dl/test_handle.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/dl/test_handle.rb b/test/dl/test_handle.rb
new file mode 100644
index 000000000..d46e16c08
--- /dev/null
+++ b/test/dl/test_handle.rb
@@ -0,0 +1,27 @@
+require 'test_base'
+
+module DL
+ class TestHandle < TestBase
+ def test_dlopen_returns_handle
+ assert_instance_of DL::Handle, dlopen(LIBC_SO)
+ end
+
+ def test_dlopen_safe
+ assert_raises(SecurityError) do
+ Thread.new do
+ $SAFE = 2
+ dlopen(LIBC_SO)
+ end.join
+ end
+ end
+
+ def test_initialize_safe
+ assert_raises(SecurityError) do
+ Thread.new do
+ $SAFE = 2
+ DL::Handle.new(LIBC_SO)
+ end.join
+ end
+ end
+ end
+end