Article View: alt.privacy.anon-server
Article #182489Re: PGP 2.6 exit status values
From: Thomas J. Boschloo
Date: Sat, 05 Mar 2005 17:54
Date: Sat, 05 Mar 2005 17:54
83 lines
4770 bytes
4770 bytes
-----BEGIN PGP SIGNED MESSAGE-----
Igenlode wrote:
> I had assumed that any non-zero exit status for a PGP 2.6 command could
> be taken as indicating an error; however, I've recently discovered a
> file that my nym-handling software refuses to display when decrypted
> because it detects an exit status of 1. The file *is*, in fact,
> decrypting correctly and can be read 'manually'!
>
> So what is the meaning of this exit code? Should the program be checking
> for "exit code value not above 1" rather than "exit code value equals
> zero" in order to detect whether the PGP call succeeded?
- From changes.doc:
+batchmode
With this option PGP won't ask any questions or prompt for
alternate file names. Some of the key commands still need
user interaction and can't be done from a shell script.
You can also use this option to check if a file has a good
signature. If the input file did not have a signature the exit
code will be 1, if the file had a signature and if it checked OK
the exit code will be 0. Note that if the input file has more
than one armored messages, a good signature on one of these
messages will make the exit code 0 (if there are no errors).
Also, from PGP.C:
/* Possible error exit codes - not all of these are used. Note that we
don't use the ANSI EXIT_SUCCESS and EXIT_FAILURE. To make things
easier for compilers which don't support enum we use #defines */
#define EXIT_OK 0
#define INVALID_FILE_ERROR 1
#define FILE_NOT_FOUND_ERROR 2
#define UNKNOWN_FILE_ERROR 3
#define NO_BATCH 4
#define BAD_ARG_ERROR 5
#define INTERRUPT 6
#define OUT_OF_MEM 7
/* Keyring errors: Base value = 10 */
#define KEYGEN_ERROR 10
#define NONEXIST_KEY_ERROR 11
#define KEYRING_ADD_ERROR 12
#define KEYRING_EXTRACT_ERROR 13
#define KEYRING_EDIT_ERROR 14
#define KEYRING_VIEW_ERROR 15
#define KEYRING_REMOVE_ERROR 16
#define KEYRING_CHECK_ERROR 17
#define KEY_SIGNATURE_ERROR 18
#define KEYSIG_REMOVE_ERROR 19
/* Encode errors: Base value = 20 */
#define SIGNATURE_ERROR 20
#define RSA_ENCR_ERROR 21
#define ENCR_ERROR 22
#define COMPRESS_ERROR 23
/* Decode errors: Base value = 30 */
#define SIGNATURE_CHECK_ERROR 30
#define RSA_DECR_ERROR 31
#define DECR_ERROR 32
#define DECOMPRESS_ERROR 33
Remember that under MS-DOS, errorlevel 1 is also true for errorlevel
2-255! So 'if errorlevel 1 echo err1' also displays 'err1' if an
errorlevel higher than 1 is set.
hth,
Thomas
- --
"All my life, I've always wondered, What it would be like to fire a
ballistic missile" - Wonderfully colored plastic war toys, The Dead
Milkmen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iQB5AwUBQinyPAEP2l8iXKAJAQFAAAMfaXufG6PUuBLBYWA/LbPWOB9YSAuaR3gO
4IyDmNL8jFIaZJq8EH1MKgj9d1rRacnoyCElyxgwESsQpFU6jZ5IjiqUOvWdX21q
/+iRX/aDCeaqErU+J4IteRjZ3YZ76eeuvRcweg==
=t4uz
-----END PGP SIGNATURE-----
Technical Details
Message-ID:
<4229f24e$0$772$3a628fcd@reader10.nntp.hccnet.nl>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-alt.privacy.anon-server.20141023.mbox.gz!number1.nntp.ams.giganews.com!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!meganewsservers.com!feeder2.on.meganewsservers.com!news.glorb.com!transit.nntp.hccnet.nl!transit1.nntp.hccnet.nl!reader.nntp.hccnet.nl!not-for-mailReferences:
<20050303013226.14475.qmail@riot.eu.org>Show Full Headers
Complete Article Headers
Message-ID: <4229f24e$0$772$3a628fcd@reader10.nntp.hccnet.nl> Subject: Re: PGP 2.6 exit status values Date: Sat, 05 Mar 2005 18:54:04 +0100 From: "Thomas J. Boschloo" <nospam@hccnet.nl.invalid> References: <20050303013226.14475.qmail@riot.eu.org> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-alt.privacy.anon-server.20141023.mbox.gz!number1.nntp.ams.giganews.com!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!meganewsservers.com!feeder2.on.meganewsservers.com!news.glorb.com!transit.nntp.hccnet.nl!transit1.nntp.hccnet.nl!reader.nntp.hccnet.nl!not-for-mail User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: alt.privacy.anon-server In-Reply-To: <20050303013226.14475.qmail@riot.eu.org> X-Enigmail-Version: 0.90.1.1 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Lines: 83 Organization: HCCnet Nieuwsgebruiker NNTP-Posting-Date: 05 Mar 2005 17:54:23 GMT NNTP-Posting-Host: 62.251.43.111 X-Trace: 1110045263 reader10.nntp.hccnet.nl 772 62.251.43.111:1129 X-Complaints-To: abuse@hccnet.nl