Actions
Bug #1732
closedInconsistency in Transference of Inherited Traits ('Tainted' and 'Untrusted') with #join
Bug #1732:
Inconsistency in Transference of Inherited Traits ('Tainted' and 'Untrusted') with #join
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.2dev (2009-07-05 trunk 23958) [i686-linux]
Backport:
Description
=begin
Array#join transfers self's taintedness and trustworthiness to its return value. If an Array is tainted, so is the concatenation of its elements:
['a'].taint.join.tainted?
=> true
['a'].untrust.join.untrusted?
=> true
However, other Enumerables with #join methods do not pass said traits to their offspring:
{'a' => 'b'}.taint.join.tainted?
=> false
{'a' => 'b'}.untrust.join.untrusted?
=> false
require 'set'
=> true
Set.new(['a','b']).taint.join.tainted?
=> false
Set.new(['a','b']).untrust.join.untrusted?
=> false
class E; include Enumerable; def initialize(*a); @e=a; end; def each; @e.each{|e| yield e}; end; end
=> nil
E.new('a','b').taint.join.tainted?
=> false
E.new('a','b').untrust.join.untrusted?
=> false
=end
Actions