mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/irb.rb (IRB::Irb::eval_input): warn and exit if $SAFE >=3
after input evaluation. * lib/irb.rb (IRB::Irb::eval_input): untaint input string. now irb works for levels 1 and 2. * ext/syck/rubyext.c (syck_loader_transfer): should not use rb_cProc directly, since type_proc may be Proc, Block, or Method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
434e71244a
commit
373a59b95b
6 changed files with 30 additions and 11 deletions
|
@ -141,10 +141,10 @@ module IRB
|
|||
end
|
||||
end
|
||||
|
||||
@scanner.each_top_level_statement do
|
||||
|line, line_no|
|
||||
@scanner.each_top_level_statement do |line, line_no|
|
||||
signal_status(:IN_EVAL) do
|
||||
begin
|
||||
line.untaint
|
||||
@context.evaluate(line, line_no)
|
||||
output_value if @context.echo?
|
||||
rescue StandardError, ScriptError, Abort
|
||||
|
@ -180,6 +180,10 @@ module IRB
|
|||
end
|
||||
print "Maybe IRB bug!!\n" if irb_bug
|
||||
end
|
||||
if $SAFE > 2
|
||||
warn "Error: irb does not work for $SAFE level higher than 2"
|
||||
exit 1
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue