[Bug 2871] New: sftp client exits with zero exit status on error

bugzilla-daemon at bugzilla.mindrot.org bugzilla-daemon at bugzilla.mindrot.org
Wed May 23 23:17:06 AEST 2018


https://bugzilla.mindrot.org/show_bug.cgi?id=2871

            Bug ID: 2871
           Summary: sftp client exits with zero exit status on error
           Product: Portable OpenSSH
           Version: 7.7p1
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P5
         Component: sftp
          Assignee: unassigned-bugs at mindrot.org
          Reporter: pcerny at suse.cz

Created attachment 3154
  --> https://bugzilla.mindrot.org/attachment.cgi?id=3154&action=edit
sftp-client.c - transform return values to {-1, 0} consistently

>From our bug report: 

--------
Our customer has found a small regression in sftp from OpenSSH 7.2p2.
The sftp command returns exit code 0 when it fails to write the file
due to the error "No space left on device". The customer has also tried
to build the latest openssh version i.e. openssh-7.7p1 and tested it,
but the problem persists.
--------

The culprit is:
commit 7d845f4a0b7ec97887be204c3760e44de8bf1f32
Author: djm at openbsd.org <djm at openbsd.org>
Date:   Wed Jan 14 13:54:13 2015 +0000

    upstream commit

    update sftp client and server to new buffer API. pretty
     much just mechanical changes; with & ok markus

It turns out it wasn't so mechanical after all - in some places the old
code compares the return value against -1 to notice an error and gets
positive integer SSH_FX_*.

I'm attaching patch from our L3. I'm not sure throwing away the
specificity of errors is the best way, but since the present code
doesn't seem to use the intermediate return values it makes things
nicely consistent.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.


More information about the openssh-bugs mailing list