When doing an scp using OpenSSH 4.4p1, 4.3p2 and 3.8 without mapping standard error or standard out to a file, the progress of a transfer is shown after the MOTD and password are entered. If either standard out or standard error are written to a file, then the progress is lost. $scp file foo@bar: foo@bar's password: file 100% 126 0.1KB/s 00:00 $scp file foo@bar: > log foo@bar's password: $cat log $ $scp file foo@bar: 2> log foo@bar's password: $cat log $
Created attachment 1228 [details] check isatty(stdout) for progress meter This is a bug in scp. It checks for stderr being a TTY before displaying the progress meter, but actually writes the progress meter to stdout. So if either is redirected then the progress meter will not be displayed. The attached patch makes the test and the writing consistent.
Comment on attachment 1228 [details] check isatty(stdout) for progress meter ok by me. Personally I think the progress meter should go to stderr not stdout but since that's how it is (including for sftp) it probably doesn't make sense to change it now.
This has been fixed in OpenBSD and now -Portable. The change will be in tomorrow's Portable snapshot and will be in the 4.6 release. Thanks for the report.
I think that the progress meter should be output to the terminal, not to stdout or stderr, which may be redirected. For instance: $ ./scp -S $PWD/ssh scp.c localhost: Enter passphrase for key '/home/vlefevre/.ssh/id_rsa': Connected to vin (from 127.0.0.1) scp.c 100% 28KB 27.6KB/s 00:00 $ That's OK. But: $ ./scp -S $PWD/ssh scp.c localhost: < /dev/null >& /dev/null Enter passphrase for key '/home/vlefevre/.ssh/id_rsa': $ I don't get the progress meter either if I use: $ ./scp -S $PWD/ssh scp.c localhost: | cat Since ssh knows how to display "Enter passphrase for key..." on the terminal, there shouldn't be any problem for the progress meter either.
Close resolved bugs after release.