Bugzilla – Bug 145577
Default CLI ftp client mangles transmitted files (does not have "binary" as default)
Last modified: 2006-02-11 11:03:22 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
AFAIK binary is not the default for normal file names. Set `binary' before using `get', `mget', `put', or `mput'.
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 :~-(
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.
petr : I vote +1 for the suggested change, having ASCII tranfer mode by default is a plain bad idea.
I'm changing severity to "Normal". Hope this won't upset Werner :-)
I am working on issue 1. 2. It is a bug in lftp_wrrapper
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
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
It is always reproduceable even on my own machine 10.1beta1 with local vsftpd server.
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.
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
fixed in beta3