| Summary: | SCP progress doesn't map to standard out or standard error | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Portable OpenSSH | Reporter: | John Thiesfeld <junkmail> | ||||
| Component: | scp | Assignee: | Damien Miller <djm> | ||||
| Status: | CLOSED FIXED | ||||||
| Severity: | minor | CC: | vincent-openssh | ||||
| Priority: | P4 | ||||||
| Version: | 4.4p1 | ||||||
| Hardware: | PPC | ||||||
| OS: | AIX | ||||||
| Bug Depends on: | |||||||
| Bug Blocks: | 1274 | ||||||
| Attachments: |
|
||||||
|
Description
John Thiesfeld
2006-12-01 03:43:16 AEDT
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. |