Opened 13 years ago

Closed 12 years ago

#1976 closed bug (Fixed)

Deluge puts torrents into obfuscated random-character directories on completion.

Reported by: fuxxy Owned by: Cas
Priority: minor Milestone: 1.3.4
Component: Core Version: 1.3.3
Keywords: Cc:

Description (last modified by Cas)

First of all, I'm an idiot. This was all my doing. However, it could happen in the future to someone else, hence the bug report. My setup consists of a linux fileserver running the deluge daemon, I'm connecting via a remote GUI on a windows computer. Both the deluge daemon and the client are 1.3.3, using libtorrent

In the "move completed" option, I specified an absolute directory path . To make things easier on myself, in PuTTY, I simply "cd" to the path I wanted, then did a 'pwd'. Afterwards, it was as simple as triple clicking the PuTTY window to select the whole line, and paste it into the Deluge client. It appears some special characters made it from PuTTY into Deluge.

RESULTING OPERATION: Anything I specified via a triple click from PuTTY ended up in a directory with special characters. Using Windows navigating to the linux samba share, the directory appeared as completely random characters, in this case "SESKUE~M". Navigating to the same directory under linux results in two possible outcomes:

deluge@coldfire /shared/TV_Shows/TV Series $ ls -alh
total 12K
drwxrwsr-x 6 deluge video 67 Nov 21 10:22 .
drwxrwsrwx 58 apache video 4.0K Nov 21 07:40 ..
drwxrwsr-x 2 deluge video 4.0K Aug 12 2010 Season 1
drwxrwxr-x 2 deluge video 6 Nov 20 17:19 Season 2
drwxr-sr-x 3 deluge video 56 Nov 21 10:22 Season 2?
drwxrwxr-x 2 deluge video 4.0K Nov 14 19:10 Season 3

deluge@coldfire /shared/TV_Shows/TV Series $ cd Season\
Season 1/ Season 2/ Season 2!^J/ Season 3/

EXPECTED OUTCOME: Possibly parse the "move completed" and "move storage" options to eliminate special characters?

Change History (7)

comment:1 Changed 13 years ago by johnnyg

  • Description modified (diff)

comment:2 Changed 13 years ago by johnnyg

Define what you mean by special characters?

A lot of deluge users have non-ascii characters in their directories so we can't go about stripping those out.

We could however strip out non-printable characters (although there seems to be no elegant way of doing this that handles unicode).

In your case you were simply including a newline character at the end of your folder so we could potentially remove leading and trailing whitespace from folder names (very easy to do) although I'm not sure this should get implemented without a way of being able to turn it off.

Anyone else have any thoughts on the matter?

comment:3 Changed 13 years ago by fuxxy

To be honest, i'm not sure exactly what extra characters are copied from selecting the whole line in PuTTY. In my opinion, special characters are OK as long as they are properly escaped.

comment:4 Changed 13 years ago by Cas

  • Description modified (diff)
  • Milestone changed from 1.3.x to 1.3.4
  • Owner set to Cas
  • Status changed from new to accepted

I already implemented a sanitize function for renaming files/folders and there are very few characters that are restricted on linux however just realised that we are talking about 'move completed' which is different piece of code.

So we could run the sanitize function in move_storage and/or when move_completed is specified in the ui. Oh and I don't think that the decoding to unicode helped matters.

fuxxy: It would be helpful if you could repeat this with debug logging enabled on deluged as the 'move completed' option is logged and should shed some light on the precise issue.

comment:5 Changed 13 years ago by Cas

  • Resolution set to fixed
  • Status changed from accepted to closed

Fix committed to 1.3-stable: d96fae520

comment:6 Changed 13 years ago by Cas

  • Component changed from other to core
  • Resolution fixed deleted
  • Status changed from closed to reopened

Not actually fixed

comment:7 Changed 12 years ago by Cas

  • Resolution set to fixed
  • Status changed from reopened to closed

Fixed properly this time: e10cfb8f

Note: See TracTickets for help on using tickets.