Hub lists fail to cache on Linux

Bug #395400 reported by Steven Sheehy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
AirDC++
Fix Released
Low
Unassigned
DC++
Confirmed
High
Unassigned

Bug Description

Thrown: FileException: No such file or directory: /home/steven/.dc++/HubLists/http_/hublist.openhublist.org/hublist.xml.bz2

This file cannot be created because it contains '/' in the filename and the sub directories "http_" and "hublist.openhublist.org" do not exist to create hublist.xml.bz2 in. The hub list URL needs to be normalized to a form suitable for both Windows and Linux. For example:

http://hublist.openhublist.org/hublist.xml.bz2 -> hublist.openhublist.org#hublist.xml.bz2

Or Util::validateFileName() needs to be split into Util::validateFilePath() and Util::validateFileName() so that validateFileName() can replace PATH_SEPARATORs in the name. This will allow the hublist to be saved as "http__hublist.openhublist.org_hublist.xml.bz2".

Tags: core
Revision history for this message
Fredrik Ullner (ullner) wrote :

The attached patch should replace the path separator with an underscore.

(I should note that when testing on Windows, just downloading a hublist, DC++ (prepatch) would create the file with underscore already and not with a directory.)

Revision history for this message
poy (poy) wrote :

that solution would flatten any file path. the issue here is that validateFileName is used for both paths (directories + separators + files) and plain files, so it can't differenciate.

Steven's suggested split seems to be the best way forward.

Fredrik Ullner (ullner)
tags: added: core
maksis (maksis)
Changed in airdcpp:
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
maksis (maksis) wrote :
Changed in airdcpp:
status: Confirmed → Fix Committed
Fredrik Ullner (ullner)
Changed in dcplusplus:
status: Confirmed → In Progress
maksis (maksis)
Changed in airdcpp:
status: Fix Committed → Fix Released
Revision history for this message
poy (poy) wrote :

the changeset linked above is perfect - can you make a patch for DC++?

Revision history for this message
Fredrik Ullner (ullner) wrote :

Apply .diff or .patch to the end of a Github URL and you'll get a patch:
https://github.com/airdcpp/airgit/commit/d101c6a81ba7913a10867aa6a2063e50cb1abf09.diff
 (I only found this out a yesterday or so.)

Revision history for this message
poy (poy) wrote :

that's cool, but a patch tailored to DC++ would be preferable. one should in particular ensure we don't have more calls to the previous function that have to be renamed.

Revision history for this message
Fredrik Ullner (ullner) wrote :

This is diff targetting DC++, based on the same principle as AirDC++.

Revision history for this message
poy (poy) wrote :

looks fine; feel free to push.

Fredrik Ullner (ullner)
Changed in dcplusplus:
status: In Progress → Fix Committed
Revision history for this message
poy (poy) wrote :

Fixed in DC++ 0.840.

Changed in dcplusplus:
status: Fix Committed → Fix Released
Revision history for this message
poy (poy) wrote :

the current patch is leading to unwanted log file path changes (eg hub.example.com.log instead of hub_example_com.log). reverted in rev 7423e91f22ae.

Changed in dcplusplus:
importance: Low → High
status: Fix Released → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.