Bug 421011 - ssh returns wrong exit status
Summary: ssh returns wrong exit status
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: openssh
Version: 8
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Tomas Mraz
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-12-12 06:57 UTC by Mikel Ward
Modified: 2008-08-02 23:40 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2007-12-19 23:13:20 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Mikel Ward 2007-12-12 06:57:19 UTC
The ssh man page says:
    ssh exits with the exit status of the remote command or with 255 if an error
occurred.

On my Fedora 8 install (openssh-4.7p1-4.fc8), it doesn't matter whether the
remote command succeeds or fails, the exit status is always 0.

$ ssh localhost true
$ echo $?
0

$ ssh localhost false
$ echo $?
0

The expected result is that "ssh localhost false" returns an exit status of 1.

My CentOS 5 install has openssh-4.3p2-24.el5 and it works fine.

I've tried as myself and as root, in case my own shell configuration is the
cause, but I get the same result.

Comment 1 Tomas Mraz 2007-12-12 07:45:50 UTC
I cannot reproduce this problem here. Can you try ssh -vvv localhost false?


Comment 2 Mikel Ward 2007-12-19 23:13:20 UTC
Sorry, there was something wrong with my environment.  ssh was actually a
wrapper script and the wrapper was doing something wrong.


Note You need to log in before you can comment on or make changes to this bug.