Bug 1791 - Newlines in filenames are converted to ^J
Summary: Newlines in filenames are converted to ^J
Status: CLOSED WONTFIX
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: scp (show other bugs)
Version: 5.3p1
Hardware: All Linux
: P2 minor
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-07 01:00 AEST by Joel R. Voss
Modified: 2011-01-24 12:33 AEDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joel R. Voss 2010-07-07 01:00:51 AEST
When copying a file with newlines (and probably many other characters) to a server with scp, the newlines are converted to ^J. Since this is not a direct copy, I consider it a bug. I do not suspect that it is a feature though I have not checked yet which part of the code is causing this. In Linux and *nix, all characters are possible in filenames except null and slash. Unicode is one good reason for this.

jvoss@ASLinWS01:~$ env | grep LA
LANG=en_US.UTF-8
LANGUAGE=
jvoss@ASLinWS01:~$ scp 'waiting
for
what1.png' altsci.com:altsci/cell/uploads/
Enter passphrase for key '/home/jvoss/.ssh/id_dsa':
waiting\^Jfor\^Jwhat1.png     100%   50KB  49.8KB/s   00:00    

jvoss@dmitry:~/altsci/cell$ ls uploads/waiting*1.png
uploads/waiting\^Jfor\^Jwhat1.png

http://www.cell-game.com/uploads/waiting%0Afor%0Awhat1.png
Comment 1 Darren Tucker 2010-07-07 08:19:59 AEST
Unfortunately this is an unfixable limitation of the scp (rcp) protocol (it uses a newline to indicate the end of the file metadata).  Use sftp if this bothers you.
Comment 2 Damien Miller 2011-01-24 12:33:58 AEDT
Move resolved bugs to CLOSED after 5.7 release