Bug 638 - scp: wrong exit status
Summary: scp: wrong exit status
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: scp (show other bugs)
Version: 3.6.1p2
Hardware: All Linux
: P2 normal
Assignee: OpenSSH Bugzilla mailing list
URL:
Keywords:
: 639 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-09-15 22:17 AEST by Harald Koenig
Modified: 2004-04-14 12:24 AEST (History)
0 users

See Also:


Attachments
check system return code. (483 bytes, patch)
2003-09-16 05:46 AEST, Markus Friedl
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Harald Koenig 2003-09-15 22:17:08 AEST
Hi OpenSSH,

at least both openssh 3.5p1 and 3.6p1 give the wrong exit status 0 (zero)
for "scp", if both source and destination are "remote" and some error
happens (e.g. disk full):


        turtle tmp > scp /tmp/BIG1 /tmp/BIG2 ; echo $?
        cp: writing `/tmp/BIG2': No space left on device
        1

        turtle tmp > scp /tmp/BIG1 turtle:/tmp/BIG2 ; echo $?
        BIG1 100% |*****************************| 10601 KB    00:01
        scp: /tmp/BIG2: No space left on device
        1

        turtle tmp > scp turtle:/tmp/BIG1 /tmp/BIG2 ; echo $?
        BIG1 100% |*****************************| 10601 KB    00:01
        /tmp/BIG2: No space left on device
        1

        turtle tmp > scp turtle:/tmp/BIG1 turtle:/tmp/BIG2 ; echo $?
        scp: /tmp/BIG2: No space left on device
==>     0


        turtle tmp > ssh -V
        OpenSSH_3.6.1p1, SSH protocols 1.5/2.0, OpenSSL 0x0090605f


this is running on SuSE Linux 7.2.
openssh binaries have been compiled myself on a RedHat 7.1 system
using gcc-2.95.3 (built myself too).



Harald Koenig
Comment 1 Markus Friedl 2003-09-16 05:46:31 AEST
Created attachment 399 [details]
check system return code.

could you please try this?
Comment 2 Harald Koenig 2003-09-16 18:30:15 AEST
*** Bug 639 has been marked as a duplicate of this bug. ***
Comment 3 Harald Koenig 2003-09-16 19:03:44 AEST
Hi Markus, 

I've tested your patch with 3.5p1 and it works
for our actual test case and current problem.

thanks for the quick fix !!


Harald.
Comment 4 Damien Miller 2003-09-16 19:13:45 AEST
It is not fixed until the fix is in the tree.
Comment 5 Markus Friedl 2003-09-20 08:55:29 AEST
patch applied.
Comment 6 Damien Miller 2004-04-14 12:24:19 AEST
Mass change of RESOLVED bugs to CLOSED