Bug #14075
closed
File.dirname("path without dir".taint) returns untainted string
Added by znz (Kazuhiro NISHIYAMA) about 7 years ago.
Updated almost 7 years ago.
Description
Is this intentional?
% ruby -e 'p [File.dirname("foo/bar".taint).tainted?, File.dirname("hoge".taint).tainted?]'
[true, false]
I found that File.split also returns untainted string with a tainted argument.
$ ruby -e 'p File.split("foo/bar".taint).map(&:tainted?); p File.split("hoge".taint).map(&:tainted?)'
[true, true]
[false, true]
- Status changed from Open to Closed
I think it is intended.
dirname
for a path without directory is ".", and this does not come from the argument string.
Also available in: Atom
PDF
Like0
Like0Like0