Bug 145577 - Default CLI ftp client mangles transmitted files (does not have "binary" as default)
Summary: Default CLI ftp client mangles transmitted files (does not have "binary" as d...
Status: RESOLVED FIXED
Alias: None
Product: SUSE Linux 10.1
Classification: openSUSE
Component: Network (show other bugs)
Version: Beta 1
Hardware: i686 SUSE Other
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Pavel Nemec
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-25 17:06 UTC by Silviu Marin-Caea
Modified: 2006-02-11 11:03 UTC (History)
1 user (show)

See Also:
Found By: Beta-Customer
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Silviu Marin-Caea 2006-01-25 17:06:08 UTC
As the default client has changed from lukemftp to lftp, the defaults need to be sanitized.

0. Top priority is to make default the "binary" option.  I don't think we need to return to the 70's ftp ascii defaults (or windows').  Modern day expectance (mine, at least) is to have binary transfer as default.

Other:
1. will "ftp user@site" work?  Because the user@ part is ignored
2. it asks for password twice

silviu_marin-caea@silviu:~> dd if=/dev/urandom of=test bs=1M count=1 ; md5sum test
1+0 records in
1+0 records out
1048576 bytes (1.0 MB) copied, 0.294918 seconds, 3.6 MB/s
d4219a11efd49867177ff5e378e3e9a3  test
silviu_marin-caea@silviu:~> ftp oracle@node1-cluster1
Wrapper for lftp to simulate compatibility with lukemftp
Name (silviu_marin-caea): oracle ### asks for user.  Should get it from oracle@
Password:
Password: ### input password twice
lftp oracle@node1-cluster1:~> put test
---- Connecting to node1-cluster1 (192.168.1.223) port 21
<--- 220 "Welcome to node1-cluster1 FTP service."
<--- 230 Login successful.
1052736 bytes transferred
lftp oracle@node1-cluster1:~> exit
silviu_marin-caea@silviu:~> ssh oracle@node1-cluster1
Last login: Wed Jan 25 16:43:12 2006 from 192.168.1.35
oracle@node1-cluster1:~> md5sum test
b586dfe3f2204cf497172334523fe919  test ### different checksum, file was transferred as ascii

oracle@node1-cluster1:~> exit
logout
Connection to node1-cluster1 closed.
silviu_marin-caea@silviu:~> ftp oracle@node1-cluster1
Wrapper for lftp to simulate compatibility with lukemftp
Name (silviu_marin-caea): oracle
Password:
Password:
lftp oracle@node1-cluster1:~> binary
lftp oracle@node1-cluster1:~> put test
---- Connecting to node1-cluster1 (192.168.1.223) port 21
<--- 220 "Welcome to node1-cluster1 FTP service."
<--- 230 Login successful.
1048576 bytes transferred
lftp oracle@node1-cluster1:~> exit
silviu_marin-caea@silviu:~> ssh oracle@node1-cluster1
Last login: Wed Jan 25 18:44:33 2006 from 192.168.1.85
oracle@node1-cluster1:~> md5sum test
d4219a11efd49867177ff5e378e3e9a3  test ### same checksum, because "binary" was specified explicitly
Comment 1 Dr. Werner Fink 2006-01-25 17:26:45 UTC
AFAIK binary is not the default for normal file names.
Set `binary' before using `get', `mget', `put', or `mput'.
Comment 2 Silviu Marin-Caea 2006-01-25 17:36:30 UTC
binary was default for lukemftp.
And it is a much more sensible default than ascii.  Really, what's to gain from having an ascii default?  It just causes unnecessary grief.

I still think it's Major, not Enhancement

Please make it binary :~-(
Comment 3 Andreas Kleen 2006-01-26 04:47:18 UTC
I agree with Silviu - having ASCII as default is a _extremly_ bad idea
because it does in 99.9% of all cases the wrong thing.


Comment 4 Cristian Rodríguez 2006-01-26 04:57:59 UTC
petr : I vote +1 for the suggested change, having ASCII tranfer mode by default is a plain bad idea.
Comment 5 Silviu Marin-Caea 2006-01-26 06:53:22 UTC
I'm changing severity to "Normal".  Hope this won't upset Werner :-)
Comment 6 Pavel Nemec 2006-01-26 07:24:56 UTC
I am working on issue 1. 2.
It is a bug in lftp_wrrapper
Comment 7 Pavel Nemec 2006-01-26 14:48:07 UTC
I can't reproduce it. I tried it and md5sum's were correct.
Binary is default for lftp too.
Please try
$ ftp oracle@node1-cluster1
...
$$ debug 10
$$ put test

and paste result here
Comment 8 Silviu Marin-Caea 2006-01-26 15:29:45 UTC
The ftp server is vsftpd-1.2.1-69.3 on SLES9.

dd if=/dev/urandom of=test bs=1M count=1
1+0 records in
1+0 records out
1048576 bytes (1.0 MB) copied, 0.293985 seconds, 3.6 MB/s
silviu_marin-caea@silviu:~> md5sum test
4f00a0433abefa77210d01ae49e7918e  test
silviu_marin-caea@silviu:~> ftp oracle@node1-cluster1
Wrapper for lftp to simulate compatibility with lukemftp
Name (silviu_marin-caea): oracle
Password:
Password:
lftp oracle@node1-cluster1:~> debug 10
lftp oracle@node1-cluster1:~> put test
dns cache hit
---- Connecting to node1-cluster1 (192.168.1.223) port 21
<--- 220 "Welcome to node1-cluster1 FTP service."
---> FEAT
<--- 530 Please login with USER and PASS.
---> AUTH TLS
<--- 530 Please login with USER and PASS.
---> USER oracle
<--- 331 Please specify the password.
---> PASS XXXX
<--- 230 Login successful.
---> FEAT
<--- 211-Features:
<---  MDTM
<---  REST STREAM
<---  SIZE
<--- 211 End
---> PWD
<--- 257 "/opt/oracle"
---> PASV
<--- 227 Entering Passive Mode (192,168,1,223,111,241)
---- Connecting data socket to (192.168.1.223) port 28657
---- Data connection established
---> STOR test
<--- 150 Ok to send data.
copy: get hit eof
copy: waiting for put confirmation
---- Closing data socket
<--- 226 File receive OK.
copy: put confirmed store
copy: get is finished - all done
1052680 bytes transferred
lftp oracle@node1-cluster1:~> exit
---> QUIT
---- Closing control socket
silviu_marin-caea@silviu:~> ssh oracle@node1-cluster1 md5sum test
fc85accbab08da2b801070d1a624343f  test
Comment 9 Silviu Marin-Caea 2006-01-26 15:39:56 UTC
It is always reproduceable even on my own machine 10.1beta1 with local vsftpd server.
Comment 10 Pavel Nemec 2006-01-27 08:10:07 UTC
I tried vsftp ( i normally use pureftpd). But everything was OK. 
Lftp use binary as default, if you need ASCII you had to use -a option, and there is no option for binary, as it is default :)
Could you please try:
$lftp
$$open your.site.ftp
$$user yourUser
$$password
$$put test
$$put -a test

I`m interested in bytes transferred, and checksums of both transfers.
In lftp, type 'set' and paste result here.

Thank you.
Comment 11 Silviu Marin-Caea 2006-01-30 13:46:29 UTC
dd if=/dev/urandom of=megabyte_of_random bs=1M count=1 ; md5sum megabyte_of_random
1+0 records in
1+0 records out
1048576 bytes (1.0 MB) copied, 0.30651 seconds, 3.4 MB/s
110f17405cf362f97ad044290c1dabcb  megabyte_of_random


silviu_marin-caea@silviu:~> lftp
lftp :~> open node1-cluster1
lftp node1-cluster1:~> user silviu_marin-caea
Password:
lftp silviu_marin-caea@node1-cluster1:~> put megabyte_of_random -o lftp-default
1048576 bytes transferred
lftp silviu_marin-caea@node1-cluster1:~> put -a megabyte_of_random -o lftp-ascii
1052710 bytes transferred
lftp silviu_marin-caea@node1-cluster1:~> exit
silviu_marin-caea@silviu:~> ftp node1-cluster1
Wrapper for lftp to simulate compatibility with lukemftp
Name (silviu_marin-caea):
Password:
lftp silviu_marin-caea@node1-cluster1:~> put megabyte_of_random -o wrapper-default
---- Connecting to node1-cluster1 (192.168.1.223) port 21
<--- 220 "Welcome to node1-cluster1 FTP service."
<--- 230 Login successful.
1052710 bytes transferred
lftp silviu_marin-caea@node1-cluster1:~> exit

ssh node1-cluster1 md5sum lftp-default lftp-ascii wrapper-default
Password:
110f17405cf362f97ad044290c1dabcb  lftp-default
44c3acb96aaa4000ec288c697061eadc  lftp-ascii
44c3acb96aaa4000ec288c697061eadc  wrapper-default
Comment 12 Silviu Marin-Caea 2006-02-11 11:03:22 UTC
fixed in beta3