From d7e8a23d414a28c772debc3dc6b41be2e3648adc Mon Sep 17 00:00:00 2001 From: aamine Date: Tue, 29 Jul 2003 13:29:53 +0000 Subject: * lib/net/smtp.rb (send0): do taint check only when $SAFE > 0 git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/net/smtp.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/net/smtp.rb b/lib/net/smtp.rb index 1f36f4ba1..ba4f43c37 100644 --- a/lib/net/smtp.rb +++ b/lib/net/smtp.rb @@ -490,9 +490,11 @@ module Net def send0( from_addr, to_addrs ) raise IOError, 'closed session' unless @socket raise ArgumentError, 'mail destination does not given' if to_addrs.empty? - raise SecurityError, 'tainted from_addr' if from_addr.tainted? - to_addrs.each do |to| - raise SecurityError, 'tainted to_addr' if to.tainted? + if $SAFE > 0 + raise SecurityError, 'tainted from_addr' if from_addr.tainted? + to_addrs.each do |to| + raise SecurityError, 'tainted to_addr' if to.tainted? + end end mailfrom from_addr -- cgit