+++ This bug was initially created as a clone of Bug #247802 +++ Description of problem: sftp problem when the partition is full. Not bailing out. Version-Release number of selected component (if applicable): sftp 1. Create a dummy partition /abc 2. Completely fill the partition /abc to 100% 3. In our application we are trying to sftp some files from /var/tmp [any directory ] to /abc. The files are getting transferred to /abc with 0 bytes [ we are trying batch mode ]. But the expected behaviour is that the sftp should bail out when it finds partition full. -- Additional comment from tmraz on 2007-08-07 16:33 EST -- Created an attachment (id=160853) Proposed patch for sftp client This patch fixes the inconsistency in sftp client behavior - with it sftp always returns exit status 1 in batch mode when the write was not completely successful. Verification steps: 1, Create filesystem device and fill it up to 100% a, Have used my flash disk i, mkfs.ext3 /dev/sdb1 ii, mount /dev/sdb1 /mnt/KINGSTON iii, stored some valid files + "dd" to ensure the 100% fullfilness of the device: dd if=/dev/zero of=/mnt/KINGSTON/nothing dd: writing `/mnt/KINGSTON/nothing': No space left on device 8+0 records in 7+0 records out 7360512 bytes (7.4 MB) copied, 2.24142 seconds, 3.3 MB/s 2, Create ssh key-pairs to be able to use sftp batch mode a, # ssh-keygen -t dsa Generating public/private dsa key pair. Enter file in which to save the key (/root/.ssh/id_dsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_dsa. Your public key has been saved in /root/.ssh/id_dsa.pub. The key fingerprint is: db:ea:78:61:63:5d:ce:ce:52:8a:4a:25:e5:ae:b1:2b root@someHost b, Copied the "/root/.ssh/id_dsa.pub" key to the /root/.ssh/authorized_keys file of the destination machine so the root login without entering pwd would be possible 3, Created file "batch" with content: put oats.rpm /mnt/KINGSTON put oats_for_testing.rpm /mnt/KINGSTON Old openssh packages (openssh-3.9p1-8.RHEL4.20.s390): 4, # sftp -b batch root@the_machine_with_precopied_public_key; echo $? sftp> put oats.rpm /mnt/KINGSTON Uploading oats.rpm to /mnt/KINGSTON/oats.rpm Couldn't write to remote file "/mnt/KINGSTON/oats.rpm": Failure sftp> put oats_for_testing.rpm /mnt/KINGSTON Uploading oats_for_testing.rpm to /mnt/KINGSTON/oats_for_testing.rpm Couldn't write to remote file "/mnt/KINGSTON/oats_for_testing.rpm": Failure sftp> 0 5, Both files "oats.rpm" and "oats_for_testing.rpm" with size "1" are created on destination (remote_machine:/mnt/KINGSTON). New openssh packages (openssh-3.9p1-8.RHEL4.24.s390): 1, Upgraded to new pkgs && restarted ssh 2, Removed files "oats.rpm" and "oats_for_testing.rpm" from /mnt/KINGSTON 3, Repeated command: # sftp -b batch root@the_remote_machine_with_precopied_public_key; echo $? sftp> put oats.rpm /mnt/KINGSTON Uploading oats.rpm to /mnt/KINGSTON/oats.rpm Couldn't write to remote file "/mnt/KINGSTON/oats.rpm": Failure 1 4, This time sftp bails out the connection after the first one unsuccessful attempt to transmit a file and returns error code. 5, The first file with "oats.rpm" with size of "1" is created on the destination /mnt/KINGSTON.
We should fix this for RHEL 5.2 as the bug will be fixed in RHEL 4.6.
This request was evaluated by Red Hat Product Management for inclusion in a Red Hat Enterprise Linux maintenance release. Product Management has requested further review of this request by Red Hat Engineering, for potential inclusion in a Red Hat Enterprise Linux Update release for currently deployed products. This request is not yet committed for inclusion in an Update release.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2008-0341.html