Forum: Ruby-core [ruby-trunk - Bug #9074][Open] Doc promotes inadequate way to sanitize a filename

7e6cdf272a7177072fecd8e019bcf6f7?d=identicon&s=25 cphoenix (Chris Phoenix) (Guest)
on 2013-11-02 09:13
(Received via mailing list)
Issue #9074 has been reported by cphoenix (Chris Phoenix).

----------------------------------------
Bug #9074: Doc promotes inadequate way to sanitize a filename
https://bugs.ruby-lang.org/issues/9074

Author: cphoenix (Chris Phoenix)
Status: Open
Priority: Normal
Assignee:
Category:
Target version:
ruby -v: 2.0.0
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


http://www.ruby-doc.org/stdlib-2.0.0/libdoc/drb/rd...
also http://www.ruby-doc.org/stdlib-1.8.7/libdoc/drb/rd...

The "server" example for the "Logger" contains these lines:
            # make the filename safe, then declare it to be so
            fname = name.gsub(/[.\/]/, "_").untaint

On Windows, backslash is a separator character. The above gsub does not
remove backslash.
054b5f6b8afdd5f6190bad08e46cd782?d=identicon&s=25 zzak (Zachary Scott) (Guest)
on 2013-11-02 15:45
(Received via mailing list)
Issue #9074 has been updated by zzak (Zachary Scott).

Category set to doc
Status changed from Open to Assigned
Assignee set to zzak (Zachary Scott)

Thanks for the report!
----------------------------------------
Bug #9074: Doc promotes inadequate way to sanitize a filename
https://bugs.ruby-lang.org/issues/9074#change-42730

Author: cphoenix (Chris Phoenix)
Status: Assigned
Priority: Normal
Assignee: zzak (Zachary Scott)
Category: doc
Target version:
ruby -v: 2.0.0
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


http://www.ruby-doc.org/stdlib-2.0.0/libdoc/drb/rd...
also http://www.ruby-doc.org/stdlib-1.8.7/libdoc/drb/rd...

The "server" example for the "Logger" contains these lines:
            # make the filename safe, then declare it to be so
            fname = name.gsub(/[.\/]/, "_").untaint

On Windows, backslash is a separator character. The above gsub does not
remove backslash.
This topic is locked and can not be replied to.