["J.H.M. Dassen" <jdassen@wi.leidenuniv.nl>] Bug#26908: gnupg: Wrong exit code

James Troup james at nocrew.org
Mon Nov 9 01:55:51 CET 1998


Hi,

This is a bug report reported via the Debian Bug Tracking System[1],
please reply to 26908 at bugs.debian.org and jdassen at wi.leidenuniv.nl as
well as the list.

I've just looked at the source and it seems to me that there's no sane
reason to pretend errors didn't occur if _not_ in batch mode, but
rather the opposite.  Perhaps something like the following was meant?

--- gnupg-0.4.3/g10/mainproc.c~	Sun Nov  8 16:43:46 1998
+++ gnupg-0.4.3/g10/mainproc.c	Mon Nov  9 01:51:41 1998
@@ -854,7 +854,7 @@
 	putc('\n', stderr);
 	if( !rc )
 	    rc = check_signatures_trust( sig );
-	if( opt.batch && rc )
+	if( !opt.batch && rc )
 	    g10_exit(1);
     }
     else {

[1] http://www.debian.org/Bugs/

-- 
James
------- Start of forwarded message -------
Subject: Bug#26908: gnupg: Wrong exit code
Reply-To: "J.H.M. Dassen" <jdassen at wi.leidenuniv.nl>, 26908 at bugs.debian.org
Resent-From: "J.H.M. Dassen" <jdassen at wi.leidenuniv.nl>
Resent-To: debian-bugs-dist at lists.debian.org
Resent-CC: James Troup <james at nocrew.org>
Resent-Date: Mon, 21 Sep 1998 18:48:00 GMT
Resent-Message-ID: <handler.26908.B.90640294825155 at bugs.debian.org>
Resent-Sender: iwj at debian.org
Message-ID: <19980920143341.A20175 at zensunni>
Date: Sun, 20 Sep 1998 14:33:41 +0200
From: "J.H.M. Dassen" <jdassen at wi.leidenuniv.nl>
To: Debian bugtracking system <submit at bugs.debian.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Organization: Ray at home

Package: gnupg
Version: 0.3.2-1
Severity: grave

According to gpg(1):
:RETURN VALUE
:       The Program returns 0 if everything was fine, 1 if at
:       least a signature was bad and other errorcode for fatal
:       errors.

However, the actual behaviour differs. With a PGP-signed .dsc file (and
using the RSA and IDEA extensions) with a deliberate error (s/r/R/ in
Architecture):
zensunni ray 14:26 ..packages/non-maintainer/dpkg > gpg
/tmp/dpkg_1.4.0.28.dsc ; echo $?
gpg (GNUPG) 0.3.2; Copyright (C) 1998 Free Software Foundation, Inc.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. See the file COPYING for details.

gpg: Warning: using insecure memory!
Source: dpkg
Version: 1.4.0.28
Binary: dpkg, dpkg-dev
Maintainer: Klee Dienes and Ian Jackson <dpkg-maint at chiark.greenend.org.uk>
ArchitectuRe: any
Standards-Version: 2.1.0.0
Files:
 b356dafd11da0749e770ee4fe444b97b 457787 dpkg_1.4.0.28.tar.gz

gpg: Signature made Sat Sep 19 17:18:25 1998 using RSA key ID 672D05C1
gpg: BAD signature from "J.H.M. Dassen (Ray) <jdassen at wi.LeidenUniv.nl>"
0
^ !!!!!

This makes it difficult to use gpg in scripts that do non-interactive
signature verification, like dinstall. As we want to switch to gpg for
signing packages, this problem is severe.

-- System Information
Debian Release: slink
Kernel Version: Linux zensunni 2.0.35 #1 Sat Aug 29 11:03:34 CEST 1998 i686 unknown

Versions of the packages gnupg depends on:
ii  libc6           2.0.7t-1       The GNU C library version 2 (run-time files)
ii  zlib1g          1.1.2-0.1      compression library - runtime
-- 
Ray Dassen jdassen at wi.LeidenUniv.nl
------- End of forwarded message -------




More information about the Gnupg-devel mailing list