Application error when drag file to coccinella contact

Bug #189298 reported by clarf
2
Affects Status Importance Assigned to Milestone
Coccinella
Fix Released
Medium
Mats

Bug Description

I get an application error when i drag a file to a coccinella contact and this file has a name with uncommond symbols.

For example when i drag and drop a file with a name: $requeriments.doc i get an error window Error: can´t read "requeriments" no such varaiable. The details are:

invalid command name "1"
invalid command name "1"
    while executing
"1"
    invoked from within
"subst $url"
    (procedure "uriencode::decodeurl" line 5)
    invoked from within
"uriencode::decodeurl $file"
    (procedure "uriencode::decodefile" line 3)
    invoked from within
"uriencode::decodefile $f"
    (procedure "::RosterTree::DnDDrop" line 6)
    invoked from within
"::RosterTree::DnDDrop .jmain.f.ro.box.tree {{C:/Documents and Settings/Andrew/My document/peoplesoft/Portal docs/$requeriments.doc}} text/uri-list 93 73"

I have Windows XP with SP2. The drag and drop function works good, but i found this error happen for files with the symbols: $ and [.

I don´t get any errors with symbols like: @#~-_%¿&()=?¡°¬!, etc...

Revision history for this message
Mats (matsben) wrote :

Scripting languages are good in many places but tend to do parsing when you don't expect it.
Switched to the tcllib's uri::urn package which handle tcl special characters. There are more to do before my own uriencode package can be trashed. I just tested that the url decoding is handling Tcl special characters, but hasn't tested actual case.

Changed in coccinella:
milestone: none → 0.96.6
status: New → Fix Committed
Revision history for this message
clarf (carocubillos) wrote :

I downloaded the coccinella 2008-02-08 versión, now i can drag and drop files with symbols $ and [. But the send file is not working again for pandion contacts. I can´t send any file to pandion users, an issue fixed in version 0.96.4 but present again by the change made. I think you are right Mats there are more to do before your own code can be trashed...

Revision history for this message
Mats (matsben) wrote :

Not sure what is going on here. Note that Pandion is still using pure HTTP (jabber:iq:oob) for file transfers and is therefore more sensitive to NATs and firewalls. I have tested this between Coccinella on MacOSX and Pandion on XP and it seems OK for me:

From Coccinella on Mac to Pandion on XP:

SEND: <iq type='set' id='1042' <email address hidden>/Pandion'><query xmlns='jabber:iq:oob'><url>http://192.168.0.3:8077/../../../Desktop/nytt%20doc%20hej$san.rtf</url></query></iq>
RECV: <iq <email address hidden>/Pandion' <email address hidden>/Coccinella@Mats-Bengtssons-dator' xml:lang='en' type='result' id='1042'/>

To Coccinella from Pandion:

RECV: <iq <email address hidden>/Pandion' <email address hidden>/Coccinella@Mats-Bengtssons-dator' xml:lang='en' type='set' id='sd17'><query xmlns='jabber:iq:oob'><url>http://192.168.0.5:1373/e265d2f3a875f1e10ca6e3da2913315bad9ea60e/nytt%20doc%20hej%24san.rtf</url><desc>165 B</desc></query></iq>
::HttpTrpt::Get url=http://192.168.0.5:1373/e265d2f3a875f1e10ca6e3da2913315bad9ea60e/nytt%20doc%20hej%24san.rtf, fileName=/Users/matben/Desktop/nytt doc hej$san2.rtf
::OOB::HttpCmd status=ok, errmsg=Hämtningen av filen nytt doc hej$san.rtf är klar.
SEND: <iq type='result' id='sd17' <email address hidden>/Pandion'/>

Note, however, the problems with Pandions progress meter. It sometimes show 0% and Finished at the same time! As you see above I actually tested with a file with "$" in its name.
It can sometime help debugging if you switch on Info/Debug menu to see the xml I/O.

Revision history for this message
Mats (matsben) wrote :

I just saw that there are still some problems in the url encoding. While I encode the name to "nytt%20doc%20hej$san.rtf" Pandion does "nytt%20doc%20hej%24san.rtf" Will investigate.

Revision history for this message
Mats (matsben) wrote :

A brief inspection of http://www.ietf.org/rfc/rfc2141.txt says that:

2.2 Namespace Specific String Syntax
...
<other> ::= "(" | ")" | "+" | "," | "-" | "." |
                     ":" | "=" | "@" | ";" | "$" |
                     "_" | "!" | "*" | "'"

You see, "$" is allowed! It doesn't matter too much if the client just does this
quoting/unquoting in a systematic fashion internally.

Revision history for this message
clarf (carocubillos) wrote :

I send some test files from Coccinella to Pandion and Coccinella doesn´t show any error. The bug track is:

SEND: <iq type='set' id='1019' <email address hidden>/Pandion'><query xmlns='jabber:iq:oob'><url>http://192.168.236.2:8077/../../../../../../../C:/Documents%20and%20Settings/Andres/Mis%20documentos/peoplesoft/Portal%20docs/portal_roi_wp.pdf</url></query></iq>
SEND:

SEND: <iq type='set' id='1020' <email address hidden>/Pandion'><query xmlns='jabber:iq:oob'><url>http://192.168.236.2:8077/../../../../../../../C:/Documents%20and%20Settings/Andres/Mis%20documentos/peoplesoft/Portal%20docs/portal_roi_wp.pdf</url></query></iq>

But from Pandion point of view there is a transmission error.

Pandion users can´t receive Coccinella files, with the 2008-02-08 breakfast versión.

Revision history for this message
Mats (matsben) wrote : Re: [Bug 189298] Re: Application error when drag file to coccinella contact

I suspect that it is the weird path in the HTTP address that confuses
Pandion. I have now rewritten my internal http server so that files
are "mounted" at its virtual file system so that no "../" will be seen
anymore. This is (was) a security risk since an evil client can get
files from anywhere on your local disk if it guesses the right
relative file path. I still allow this but can switch off it any time
now since oob isn't depending on it anymore.

This time I even tested it with both clients on an XP box. Tested also
encoding names as "My (new) $hej.txt".

On 2/14/08, clarf <email address hidden> wrote:
> I send some test files from Coccinella to Pandion and Coccinella doesn´t
> show any error. The bug track is:
>
> SEND: <iq type='set' id='1019' <email address hidden>/Pandion'><query
> xmlns='jabber:iq:oob'><url>http://192.168.236.2:8077/../../../../../../../C:/Documents%20and%20Settings/Andres/Mis%20documentos/peoplesoft/Portal%20docs/portal_roi_wp.pdf</url></query></iq>
> SEND:
>
> SEND: <iq type='set' id='1020' <email address hidden>/Pandion'><query
> xmlns='jabber:iq:oob'><url>http://192.168.236.2:8077/../../../../../../../C:/Documents%20and%20Settings/Andres/Mis%20documentos/peoplesoft/Portal%20docs/portal_roi_wp.pdf</url></query></iq>
>
> But from Pandion point of view there is a transmission error.
>
> Pandion users can´t receive Coccinella files, with the 2008-02-08
> breakfast versión.
>
> --
> Application error when drag file to coccinella contact
> https://bugs.launchpad.net/bugs/189298
> You received this bug notification because you are a member of
> Coccinella, which is the bug contact for Coccinella.
>

sander (s-devrieze)
Changed in coccinella:
assignee: nobody → matsben
importance: Undecided → Medium
Revision history for this message
Mats (matsben) wrote :

This was already fixed a week ago or so. I replaced my own uriencode::decodeurl
with the better and non buggy ::uri::urn::unquote from tcllib.
Just tested current cvs on XP with files with "xyz $hej.txt" to
Pandion and it works.

Sidenote: I'm currently doing work for Tcl/Tk 8.5 and at times there
might sneek in
8.4 incompatibilities which I try to fix ASAP:

On 2/19/08, sander <email address hidden> wrote:
> ** Changed in: coccinella
> Importance: Undecided => Medium
> Assignee: (unassigned) => Mats (matsben)
>
> --
> Application error when drag file to coccinella contact
> https://bugs.launchpad.net/bugs/189298
> You received this bug notification because you are a bug assignee.
>

Revision history for this message
clarf (carocubillos) wrote :

Hi Mat, i finally found the error. I can´t send files to Pandion user´s when the file is located in a directory like "My documents" or any other directory in C (first hard disk in Windows), when i try to send the same file from a directory located in D like D:\downloads or d:\temp i don´t have this error.

 As you can see in the log:

SEND: <iq type='set' id='1018' <email address hidden>/Pandion'><query xmlns='jabber:iq:oob'><url>http://192.168.236.19:8077/../../../../../24-33.pdf</url></query></iq>
RECV: <iq type="result" <email address hidden>/Coccinella@zule-310984f35e" id="1018" <email address hidden>/Pandion"/>
SEND: <iq type='set' id='1019' <email address hidden>/Pandion'><query xmlns='jabber:iq:oob'><url>http://192.168.236.19:8077/../../../../../../../C:/Documents%20and%20Settings/Andrew/Mis%20documentos/peoplesoft/srnavigationbasics.pdf</url></query></iq>
SEND:

SEND:

SEND: <iq type='set' id='1022' <email address hidden>/Pandion'><query xmlns='jabber:iq:oob'><url>http://192.168.236.19:8077/../../../../../../../C:/coccinella/test/PeopleSoftPortalOverview_040605%5B1%5D.pdf</url></query></iq>

SEND: <iq type='set' id='1025' <email address hidden>/Pandion'><query xmlns='jabber:iq:oob'><url>http://192.168.236.19:8077/../../../../../../../C:/coccinella/PeopleSoftPortalOverview.pdf</url></query></iq>
SEND:

SEND: <iq type='set' id='1026' <email address hidden>/Pandion'><query xmlns='jabber:iq:oob'><url>http://192.168.236.19:8077/../../../../../../coccinella/test/PeopleSoftPortalOverview.pdf</url></query></iq>
RECV: <iq type="result" <email address hidden>/Coccinella@zule-310984f35e" id="1026" <email address hidden>/Pandion"/>
SEND:

SEND: <iq type='set' id='1027' <email address hidden>/Pandion'><query xmlns='jabber:iq:oob'><url>http://192.168.236.19:8077/../../../../../../coccinella/test/PeopleSoftPortalOverview_040605%5B1%5D.pdf</url></query></iq>
RECV: <iq type="result" <email address hidden>/Coccinella@zule-310984f35e" id="1027" <email address hidden>/Pandion"/>

The first attempt where made from d:\downloads with file "24-33.pdf" (it was successful), the second attempt from "My documents" with file srnavigationbasics.pdf (i didn´t get a RECV response here) i get an error from Pandion, the third and fourth attempt made from C:\coccinella\test with files "PeopleSoftPortalOverview.pdf" and "PeopleSoftPortalOverview_040605[1].pdf" i receive an error, But the same files sent from D:\coccinella\test (attempt 5 y 6) i could send the files without any error.

A very strange error we have here....

Revision history for this message
Mats (matsben) wrote :

The code has been rewritten lately so it wont use all the "../"
relative paths at all which confuses Pandion. So please get the dev
version from: http://coccinella.im/breakfast/ and test. The url file
paths I was using were "unconventional". It should work now.

Revision history for this message
clarf (carocubillos) wrote :

Hi Mat, it seems to works fine. I made some test sending files from "my documents", system drive and cd drives. Using .pdf, .html, .txt, .ppt and other files. I also use files with any kind of valid names in both ways. Thank you again.

sander (s-devrieze)
Changed in coccinella:
status: Fix Committed → Fix Released
Revision history for this message
clarf (carocubillos) wrote :

Hi Mat, in new coccinella version (0.96.6) transfers works between Pandion and coccinella in both ways, but i found something that i dind´t see before, i have problems when i try to send a file with a latinoamerican character name, the problem is present when i send this file from Coccinella to Pandion not in the other way. The file has a Accented words like: á,é,í. As you see my native language is Spanish...

From Coccinella to Pandion (Error):

SEND: <iq type='set' id='1016' <email address hidden>/Pandion'><query xmlns='jabber:iq:oob'><url>http://192.168.236.19:8077/httpd/mnt/3a33e6c2-2436988c/Documentaci%F3n%20procesos%20de%20creaci%F3n%20y%20eliminaci%F3n%20de%20usuarios.pdf</url></query></iq>
SEND: <iq type='set' id='1017' <email address hidden>/Pandion'><query xmlns='jabber:iq:oob'><url>http://192.168.236.19:8077/httpd/mnt/3c176ac9-7c5921e6/Documentaci%F3n%20procesos%20de%20creaci%F3n%20y%20eliminaci%F3n%20de%20usuarios.pdf</url></query></iq>
SEND:

From Pandion to coccinella (Transfer Completed):

RECV: <iq type="set" <email address hidden>/Coccinella@zule-310984f35e" id="sd12" <email address hidden>/Pandion"><query xmlns="jabber:iq:oob"><url>http://192.168.236.19:3199/d3e891a0428d515ab718c5fef57c22a61ec2d4f8/Documentaci%C3%B3n%20procesos%20de%20creaci%C3%B3n%20y%20eliminaci%C3%B3n%20de%20usuarios.pdf</url><desc>1.9 MB</desc></query></iq>
SEND: <iq type='result' id='sd12' <email address hidden>/Pandion'/>

Could this be fixed. I think this is the last bug i report for this file transfer topic.

Revision history for this message
sander (s-devrieze) wrote :

Can you add this as a new bug entry? This bug is already closed and it'll make Mats life easier when each bug has its own entry. PS: "I think this is the last bug i report for this file transfer topic."<--you better report all bugs ;-)

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.