diff options
author | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-09-08 13:16:57 +0000 |
---|---|---|
committer | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-09-08 13:16:57 +0000 |
commit | 8951a69a16e446251b6c45a96aa1eea668d120ca (patch) | |
tree | c16e0865ae7dd2e7b700907380c7edc0b6f2484b /ext/tk/lib/multi-tk.rb | |
parent | 4b98d170229844cbd81f20f8da44900a852810ad (diff) | |
download | ruby-8951a69a16e446251b6c45a96aa1eea668d120ca.tar.gz |
* multi-tk.rb: modify security check at creating a new interpreter
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/lib/multi-tk.rb')
-rw-r--r-- | ext/tk/lib/multi-tk.rb | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/ext/tk/lib/multi-tk.rb b/ext/tk/lib/multi-tk.rb index 7053dddef9..750a2b79d9 100644 --- a/ext/tk/lib/multi-tk.rb +++ b/ext/tk/lib/multi-tk.rb @@ -459,12 +459,20 @@ class MultiTkIp ###################################### def initialize(master, safeip=true, keys={}) - if safeip == nil && !master.master? - fail SecurityError, "slave-ip cannot create master-ip" + if $SAFE >= 4 + fail SecurityError, "cannot create a new interpreter at level #{$SAFE}" + end + + if safeip == nil && $SAFE >= 2 + fail SecurityError, "cannot create a master-ip at level #{$SAFE}" end - if safeip == nil && $SAFE >= 4 - fail SecurityError, "cannot create master-ip at level #{$SAFE}" + if !master.master? && master.safe? + fail SecurityError, "safe-slave-ip cannot create a new interpreter" + end + + if safeip == nil && !master.master? + fail SecurityError, "slave-ip cannot create a master-ip" end unless keys.kind_of? Hash |