Re: Exit Codes
"Wong, Alexander C" <[email protected]> Wed, 11 Jul 2012 15:43:50 +0000
| Newsgroups | gmane.comp.encryption.cryptlib |
|---|---|
| Message-ID | <997707FBFC07324185B17BCE9599C75C10A2B0C3@FMSMSX107.amr.corp.intel.com> |
Hi Lloyd, We're scoping this and trying to see what the right place for implementing exit codes would be in Cryptlib for the KTS SSH daemon[1]. The right exit codes are the values that one would get from a terminated process; that is, typically, 0 for success, nonzero for error. We have a test case that exits with exit code atoi(argv[0]) (equivalent). What's the best way to implement this shim? It appears that Cryptlib handles all required network I/O and processes the messages at and below the SSH channel level. Does Cryptlib expose an interface for sending arbitrary SSH_MSG_CHANNEL_REQUEST messages? The relevant message type is SSH_MSG_CHANNEL_REQUEST, as per rfc4252, with subtype "exit-status": >6.10. Returning Exit Status > > When the command running at the other end terminates, the following > message can be sent to return the exit status of the command. > Returning the status is RECOMMENDED. No acknowledgement is sent for > this message. The channel needs to be closed with > SSH_MSG_CHANNEL_CLOSE after this message. > > The client MAY ignore these messages. > > byte SSH_MSG_CHANNEL_REQUEST > uint32 recipient channel > string "exit-status" > boolean FALSE > uint32 exit_status Thanks, Alex [1] http://www.kpym.com/2/kpym/index.htm -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Lloyd Parkes Sent: Monday, July 09, 2012 5:47 PM To: [email protected] Subject: Re: [Cryptlib] Exit Codes On 10/07/2012, at 6:48 AM, Hoskins, William wrote: > A coworker and I are attempting to edit cryptlib so that it will give us the correct exit codes. What are these correct exit codes and what codes are you getting from cryptlib? I'm guessing that you want to call cryptlib from some code you haven't mentioned. The normal way of doing this is to write a shim that does the translation for you. That way you can leave cryptlib unchanged (which is handy for maintenance) and the code you need to maintain is in one well defined place rather than scattered throughout someone else's code. Cheers, Lloyd _______________________________________________ Cryptlib mailing list [email protected] via Mail: [email protected] Archive: ftp://ftp.franken.de/pub/crypt/cryptlib/archives/ http://news.gmane.org/gmane.comp.encryption.cryptlib Posts from non-subscribed addresses are blocked to prevent spam, please subscribe in order to post messages.