bugzilla-daemon at mindrot.org
2004-Jul-04 04:18 UTC
[Bug 891] possible problem with non-printing characters during scp copy
http://bugzilla.mindrot.org/show_bug.cgi?id=891 Summary: possible problem with non-printing characters during scp copy Product: Portable OpenSSH Version: 3.6.1p2 Platform: ix86 OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: scp AssignedTo: openssh-bugs at mindrot.org ReportedBy: dogbert at netnevada.net Hello, System: Red Hat Workstation Edition Kernel: Linux content 2.4.21-15.0.2.ELcustom #2 SMP Sun Jun 27 10:04:31 PDT 2004 i686 i686 i386 GNU/Linux OpenSSH: [content at content content]$ rpm -q openssh version is openssh-3.6.1p2-33.30.1 I encountered a problem which might be a bug in 'scp' when attempting to do a recursive copy of files from a existing linux system onto a new linux ystem. The problem happened when the 'scp' reached a directory which had a file '???.HTM' in it, and the scp aborted with the following message: Protocol Control Error I attempted to repeat the 'scp' the next day, and it died out in the same directory as the previous day, with the same error message. I tried to remove the file in question, but 'rm' wouldn't allow me to, so I used 'rm -i *.HTM' so that I would be asked about each file in the directory one at a time, when it got to the '???.HTM', it showed that the file was actually \n\r\n.HTM (and the rm -i allowed me to remove it) after this file was removed, I ran the scp again the following day, and the job completed normally without any errors at all. If you need more information, please email me at dogbert at netnevada.net Bill Parker ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.
bugzilla-daemon at mindrot.org
2004-Jul-04 06:14 UTC
[Bug 891] possible problem with non-printing characters during scp copy
http://bugzilla.mindrot.org/show_bug.cgi?id=891 ------- Additional Comments From dtucker at zip.com.au 2004-07-04 16:14 ------- Created an attachment (id=680) --> (http://bugzilla.mindrot.org/attachment.cgi?id=680&action=view) Encode newlines in filename for scp transfer It looks like the sending scp bails on the file because the name contains a newline (inside the protocol the file details are sent as "Cmodes size name\n" so there's no way to encode a literal newline into a filename). When the sending scp bails, the receiving scp gets out of sync and drops the connection. We could do something like the attached which encodes them as printable chars. The file will transfer but the name will be wrong. On the other hand, the scp protocol is obsolete and has unfixable limitations, it might not be worth fiddling with it any more. If anyone wants to play with this, try: mkdir /tmp/tmp1 perl -e 'open(a, ">/tmp/tmp1/t\n\r\n.HTM")'; scp -r /tmp/tmp1 localhost:/tmp/tmp2 ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.