| Summary: | sftp returns 0 when upload is unsuccessful due to a full device | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Portable OpenSSH | Reporter: | Tomas Jirka <jirkat> | ||||
| Component: | sftp | Assignee: | Assigned to nobody <unassigned-bugs> | ||||
| Status: | CLOSED FIXED | ||||||
| Severity: | normal | CC: | djm | ||||
| Priority: | P2 | ||||||
| Version: | 4.2p1 | ||||||
| Hardware: | ix86 | ||||||
| OS: | Linux | ||||||
| Bug Depends on: | |||||||
| Bug Blocks: | 1274 | ||||||
| Attachments: |
|
||||||
|
Description
Tomas Jirka
2006-10-21 08:46:40 AEST
Created attachment 1232 [details]
propogate error status on upload falure
Thanks for the report. This is a bug in sftp-client.c:do_upload(). The error status on a write failure was not being returned to the caller.
BTW in interactive mode (the default when sftp is started for a tty), the return value will be zero anyway because the sftp client exits normally. A better demonstration is batch mode, where the sftp client's exit status will reflect the failure of a command:
echo "put /bin/ls /dev/full" | sftp -b - linux-host
(substitute a full filesystem for /dev/full if you don't have Linux)
This patch has been committed and will be in OpenSSH 4.6. Thanks for the report! Close resolved bugs after release. |