sanko / net-bittorrent

Perl based BitTorrent module available on CPAN
http://sankorobinson.com/net-bittorrent/
Other
13 stars 3 forks source link

Issues with Some File Names #5

Closed Ratief closed 9 years ago

Ratief commented 9 years ago

I have been writing a script that uses this module to verify some torrent files and recently came across several torrents that have files with '...' in their file names. Net::BitTorrent ALWAYS fails to open these files.

After digging into this a bit I finally figured out that it is line 164 of BitTorrent/Torrent.pm. I have yet to figure out what that line is trying to do, but it mangles the file names such that it always fails to open the correct file.

Example: original file name="... Its Hour Come Round at Last.txt" mangled file name=". Its Hour Come Round at Last.txt"

sanko commented 9 years ago

That's a cheap (and looking at it now, still very insecure) attempt to sanitize file names to keep them from being things like ..\..\[...] and clobbering files outside of their directory. You can comment it out if you like.

I'd really rather you use try AnyEvent::BitTorrent though. Net::BitTorrent probably won't get any updates but AnyEvent::BitTorrent is a lot less complex internally without loosing much on the user side. It'll likely be the future of Net::BitTorrent (with perl6?).