Actions
Bug #14075
closedFile.dirname("path without dir".taint) returns untainted string
Description
Is this intentional?
% ruby -e 'p [File.dirname("foo/bar".taint).tainted?, File.dirname("hoge".taint).tainted?]'
[true, false]
Updated by hkdnet (Ko Sato) about 7 years ago
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]
Updated by nobu (Nobuyoshi Nakada) about 7 years ago
- 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.
Actions
Like0
Like0Like0