From owner-freebsd-questions@FreeBSD.ORG Mon Dec 1 09:21:26 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70BD51065675 for ; Mon, 1 Dec 2008 09:21:26 +0000 (UTC) (envelope-from libc.mail@gmail.com) Received: from mail-gx0-f61.google.com (mail-gx0-f61.google.com [209.85.217.61]) by mx1.freebsd.org (Postfix) with ESMTP id 999B68FC2D for ; Mon, 1 Dec 2008 09:21:25 +0000 (UTC) (envelope-from libc.mail@gmail.com) Received: by gxk21 with SMTP id 21so2970561gxk.27 for ; Mon, 01 Dec 2008 01:21:24 -0800 (PST) MIME-Version: 1.0 Received: by 10.151.41.21 with SMTP id t21mr28048ybj.27.1228123284823; Mon, 01 Dec 2008 01:21:24 -0800 (PST) Date: Mon, 1 Dec 2008 01:21:24 -0800 (PST) In-Reply-To: <7A98FEF9-AA2E-4860-A1BD-A15BD9CACA34@hughes.net> X-IP: 83.237.103.45 References: <7A98FEF9-AA2E-4860-A1BD-A15BD9CACA34@hughes.net> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_5; ru-ru) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1, gzip(gfe), gzip(gfe) Message-ID: From: Eugene Pimenov To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable Subject: Re: Pasting via ssh causes data loss X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2008 09:21:26 -0000 On 1 =C4=C5=CB, 05:03, Chris wrote: > > I was curious about your situation and set up a couple of tests. Noting > you mentioned iTerm, I thought I might be able to recreate it on a Mac > (OS-X 10.4 with 1.4.3 (100) version Terminal, I had removed iTerm due > to unreliability sometime back). I've downloaded iTerm for this test. I'm using Apple's Terminal.app. > > I copied a 23094 byte program I was working on locally in MacVIM. I > first did > a cat >testfile then pasted through an ssh terminal.app connection > over satellite (very > bad connection) into a FreeBSD 7.0 box I built in the last month. At > the far end it received 23094 bytes. sftp of the file to the remote and > diff showed no differences. I then opened an ssh session to a FreeBSD > server > on my local lan and repeated with the same results. No problems. I believe that FreeBSD fetches all data. When I ssh back to my mac from FreeBSD, I recieve all data all the time. TCP should handle errors, so nothing surprising here. > > The problem does not appear to be obvious or common so there must be > something > unique about how this situation if you have reproduced it on two > different terminal programs using ssh that would work correctly to other > servers using the same shell and collection method (e.g. cat >blah). I tried zsh, sh, bash and my program on the freebsd box. > > Something missing here. Have you checked if you have > errors shown on the interface of the server? Are there losses if you > sftp > the files from your machine to the remote (Try pushing a 1.5 MB file and > see if that shows failures). Did you install something other than the > default > OpenSSH on the server? Do the text files have something other than text > in them or even control sequences for the remote? Just taking > potshots here. sftp doesn't lose data. Even cat file | ssh host 'cat >file' doesn't. Only pasting. It's 100% reproducible, I don't think it's some kind of side effect. $ netstat -I bge0 Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll bge0 1500 00:a0:d1:e3:fd:9c 55134708 0 48858321 0 0 (no errors) Terminal sessions: http://pastie.org/327615.txt?key=3Dopkxhrjptnh3lebyn8rjlq http://pastie.org/327617.txt?key=3Dgaznt1zmfi7usps74n2h5w I believe nothing strange was installed on the server... it's a typical freebsd web-server. > > A somewhat side note here, I would personally never think to move > files this > way since it's quite possible that content of files can disrupt the > stream. > I tend to use sftp. > I never do that for binary files. I use sftp either. However, when I need to change some source on a server, I already have an opened text editor with the file and a terminal, in that case cat >file is just quickier. BTW, thank you for your help, guys...