Project

General

Profile

Actions

Bug #14075

closed

File.dirname("path without dir".taint) returns untainted string

Added by znz (Kazuhiro NISHIYAMA) over 6 years ago. Updated over 6 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:83646]

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) over 6 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]
Actions #2

Updated by nobu (Nobuyoshi Nakada) over 6 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

Also available in: Atom PDF

Like0
Like0Like0