Bug #9074

Doc promotes inadequate way to sanitize a filename

Added by Chris Phoenix 6 months ago. Updated 6 months ago.

[ruby-core:58137]
Status:Closed
Priority:Normal
Assignee:Zachary Scott
Category:doc
Target version:-
ruby -v:2.0.0 Backport:1.9.3: UNKNOWN, 2.0.0: UNKNOWN

Description

http://www.ruby-doc.org/stdlib-2.0.0/libdoc/drb/rdoc/DRb.html
also http://www.ruby-doc.org/stdlib-1.8.7/libdoc/drb/rdoc/DRb.html

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.

Associated revisions

Revision 43632
Added by Zachary Scott 6 months ago

  • lib/drb/drb.rb: [DOC] promote better windows-safe filename regular expression in DRb Logger example. Reported by Chris Pheonix [Bug #9074]

History

#1 Updated by Zachary Scott 6 months ago

  • Category set to doc
  • Status changed from Open to Assigned
  • Assignee set to Zachary Scott

Thanks for the report!

#2 Updated by Zachary Scott 6 months ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r43632.
Chris, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • lib/drb/drb.rb: [DOC] promote better windows-safe filename regular expression in DRb Logger example. Reported by Chris Pheonix [Bug #9074]

Also available in: Atom PDF