summaryrefslogtreecommitdiff
path: root/ext/tk/lib/tk.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/tk/lib/tk.rb')
-rw-r--r--ext/tk/lib/tk.rb28
1 files changed, 5 insertions, 23 deletions
diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb
index 45f86a9253..dd29589e86 100644
--- a/ext/tk/lib/tk.rb
+++ b/ext/tk/lib/tk.rb
@@ -1785,9 +1785,7 @@ EOS
end
def appsend(interp, async, *args)
- if $SAFE >= 4
- fail SecurityError, "cannot send Tk commands at level 4"
- elsif $SAFE >= 1 && args.find{|obj| obj.tainted?}
+ if $SAFE >= 1 && args.find{|obj| obj.tainted?}
fail SecurityError, "cannot send tainted Tk commands at level #{$SAFE}"
end
if async != true && async != false && async != nil
@@ -1802,9 +1800,7 @@ EOS
end
def rb_appsend(interp, async, *args)
- if $SAFE >= 4
- fail SecurityError, "cannot send Ruby commands at level 4"
- elsif $SAFE >= 1 && args.find{|obj| obj.tainted?}
+ if $SAFE >= 1 && args.find{|obj| obj.tainted?}
fail SecurityError, "cannot send tainted Ruby commands at level #{$SAFE}"
end
if async != true && async != false && async != nil
@@ -1820,9 +1816,7 @@ EOS
end
def appsend_displayof(interp, win, async, *args)
- if $SAFE >= 4
- fail SecurityError, "cannot send Tk commands at level 4"
- elsif $SAFE >= 1 && args.find{|obj| obj.tainted?}
+ if $SAFE >= 1 && args.find{|obj| obj.tainted?}
fail SecurityError, "cannot send tainted Tk commands at level #{$SAFE}"
end
win = '.' if win == nil
@@ -1838,9 +1832,7 @@ EOS
end
def rb_appsend_displayof(interp, win, async, *args)
- if $SAFE >= 4
- fail SecurityError, "cannot send Ruby commands at level 4"
- elsif $SAFE >= 1 && args.find{|obj| obj.tainted?}
+ if $SAFE >= 1 && args.find{|obj| obj.tainted?}
fail SecurityError, "cannot send tainted Ruby commands at level #{$SAFE}"
end
win = '.' if win == nil
@@ -1899,7 +1891,7 @@ EOS
INTERP_ROOT_CHECK.wait(INTERP_MUTEX)
status = INTERP_THREAD_STATUS.value
if status && TkCore::INTERP.default_master?
- INTERP_THREAD_STATUS.value = nil if $SAFE < 4
+ INTERP_THREAD_STATUS.value = nil
raise status if status.kind_of?(Exception)
end
}
@@ -2209,9 +2201,6 @@ module Tk
# tk_split_simplelist(INTERP._invoke('set', 'tcl_libPath'))
when :PLATFORM, :TCL_PLATFORM
- if $SAFE >= 4
- fail SecurityError, "can't get #{sym} when $SAFE >= 4"
- end
INTERP._invoke_without_enc('global', 'tcl_platform')
Hash[*tk_split_simplelist(INTERP._invoke_without_enc('array', 'get',
'tcl_platform'))]
@@ -3746,7 +3735,6 @@ module TkConfigMethod
@mode || false
end
def TkConfigMethod.__set_IGNORE_UNKNOWN_CONFIGURE_OPTION__!(mode)
- fail SecurityError, "can't change the mode" if $SAFE>=4
@mode = (mode)? true: false
end
@@ -5650,9 +5638,6 @@ class TkWindow<TkObject
end
def wait_visibility(on_thread = true)
- if $SAFE >= 4
- fail SecurityError, "can't wait visibility at $SAFE >= 4"
- end
on_thread &= (Thread.list.size != 1)
if on_thread
INTERP._thread_tkwait('visibility', path)
@@ -5676,9 +5661,6 @@ class TkWindow<TkObject
alias thread_tkwait_visibility thread_wait_visibility
def wait_destroy(on_thread = true)
- if $SAFE >= 4
- fail SecurityError, "can't wait destroy at $SAFE >= 4"
- end
on_thread &= (Thread.list.size != 1)
if on_thread
INTERP._thread_tkwait('window', epath)