openssh not reporting the correct errorlevel

Dave Korn dave.korn@artimi.com
Tue Aug 28 18:04:00 GMT 2007


On 28 August 2007 18:02, DePriest, Jason R. wrote:

>> *  (Mon, 27 Aug 2007 11:55:23 -0700 (PDT))
>>> Here are the command sequence I ran on Windows 2003 x86 SP2 servers (delhi
>>> is the hostname) C:\>ssh delhi net The syntax of this command is:
>>> 
>>> NET [ ACCOUNTS | COMPUTER | CONFIG | CONTINUE | FILE | GROUP | HELP |
>>>       HELPMSG | LOCALGROUP | NAME | PAUSE | PRINT | SEND | SESSION |
>>>       SHARE | START | STATISTICS | STOP | TIME | USE | USER | VIEW ]
>>> 
>>> 
>>> C:\>echo %errorlevel%
>>> 0
>>> 
>>> ANALYSIS:
>>> The errorlevel returned from the second command should be "1"
>>> instead of "0".

> The command entered looks correct to me.
> 
> He is connecting to remote host 'delhi' using ssh and executing the
> 'net' command on 'delhi' which correctly outputs its usage
> information.  Ssh then disconnects and returns him to the local
> system.

  I spent some time trying to reproduce this with various combinations of linux
and windows servers, native win32 and cygwin commmands being run at the remote
end when windows, etc., etc., and I couldn't find any way to reproduce it.
Absolutely everything WJFFM, including the original example:

----------------------------------<snip>----------------------------------
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\dk>net start sshd
The CYGWIN sshd service is starting.
The CYGWIN sshd service was started successfully.


C:\Documents and Settings\dk>ssh localhost net
Enter passphrase for key '/home/dk/.ssh/id_rsa':
The syntax of this command is:


NET [ ACCOUNTS | COMPUTER | CONFIG | CONTINUE | FILE | GROUP | HELP |
      HELPMSG | LOCALGROUP | NAME | PAUSE | PRINT | SEND | SESSION |
      SHARE | START | STATISTICS | STOP | TIME | USE | USER | VIEW ]


C:\Documents and Settings\dk>echo %errorlevel%
1

C:\Documents and Settings\dk>ssh localhost net session
Enter passphrase for key '/home/dk/.ssh/id_rsa':
Enter passphrase for key '/home/dk/.ssh/id_rsa':
There are no entries in the list.


C:\Documents and Settings\dk>echo %errorlevel%
0

C:\Documents and Settings\dk>
----------------------------------<snip>----------------------------------


  Cygcheck.out attached, so that we can compare ssh client and server package
versions (once OP gets the hint that cgf dropped fairly loudly a post or two
upthread!)


    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygcheck.out
Type: application/octet-stream
Size: 80389 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20070828/a4c2f9b8/attachment.obj>
-------------- next part --------------
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


More information about the Cygwin mailing list