#708372 don't say "100%" until the file is really fully transmitted

Package:
openssh-client
Source:
openssh
Description:
secure shell (SSH) client, for secure access to remote machines
Submitter:
Date:
2014-12-26 05:06:05 UTC
Severity:
important
#708372#5
Date:
2013-05-15 12:05:54 UTC
From:
To:
scp prints "100%" at the very beginning of the transmission.
Whereupon people think the job is done and close down their computers
only to discover the next day the file was not fully transmitted to
their boss after all etc. etc.

$ scp big_file mysite.com:
dieyuan_logo_1181x1073.jpg                                                   100%  794KB 793.9KB/s   00:00

It should wait for the file to really be fully transited before saying that!

A clear and undeniable bug.

Try it on a slow connection for proof!

#708372#10
Date:
2013-05-24 22:15:28 UTC
From:
To:
These people wrote the original version of scp, but I don't believe they
have been involved since OpenSSH was created.  Please don't bother them
about this.

I agree that this is a bug.  Unfortunately it turns out to be difficult
to fix for the reasons given in the OpenSSH FAQ:

http://www.openssh.org/faq.html#2.10

Specifically, a natural fix for this bug would require extending the scp
"protocol" to have the sink end of the connection send acknowledgements
back to the source each time it's received a chunk of data.  Given
interoperability requirements, I think this is very unlikely to be
feasible.

Normally, the answer to this kind of thing would be "use sftp instead".
However, I checked and it has the same bug, even though the SFTP
protocol does involve sending back acknowledgement messages after
receiving each chunk of data.  That means this is just a client bug, so
it should be quite tractable, and indeed was only a few minutes' work.
I filed https://bugzilla.mindrot.org/show_bug.cgi?id=2108 upstream with
a patch which fixes sftp's progress meter to behave as you request; I
hope they'll accept that.

Now, that only provides a workaround in the form of using a different
program, and doesn't really fix this bug properly since for many
purposes scp's interface is more convenient.  I have been meaning for a
long time to convert scp into an SFTP client under the covers, when it
isn't being called in such a way that requires it to speak the old
protocol.  If I ever manage to do that, or anyone else for that matter,
then that would allow this bug to be fixed properly, along with a number
of others.  Until then it will have to be blocked.

Thanks,

#708372#15
Date:
2013-05-25 08:16:17 UTC
From:
To:
Thanks.
Good thing banks don't work that way.

#708372#20
Date:
2013-05-25 10:09:03 UTC
From:
To:
Too bad they do from a consumer point of view.
#708372#25
Date:
2014-12-26 05:02:55 UTC
From:
To:
Please confirm that
https://bugzilla.mindrot.org/show_bug.cgi?id=2108
has been applied and
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=708372
can be closed.

I think the bug is still there in 1:6.7p1-3.

But I can't tell, as there are two changelogs etc.