when trying to upload a file via sftp and the disk on the server is full, sftp returns succes (0) although it should return non-zero code. repeatable on: linux 2.6.1x ix86,OpenSSH_4.0p1,OpenSSH_4.2p1 the cause may be the same as in bug 773 $ sftp localhost Connecting to localhost... sftp> cd /tmp/full sftp> put my.img Uploading my.img to /tmp/pokus/my.img my.img 0% 0 0.0KB/s --:-- ETACouldn't write to remote file "/tmp/full/my.img": Failure -2147483648% 11449TB 31.1MB/s $ echo $? 0
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.