summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_install
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>1999-10-01 01:14:39 +0000
committerMarc Espie <espie@cvs.openbsd.org>1999-10-01 01:14:39 +0000
commit72fa93833cc266e7abf4bd6dba12c5a09cbdd683 (patch)
treeea05f79120280731826b98fefd6610d0bc1b1bcb /usr.sbin/pkg_install
parentd784a738139448819b0f9634632e144f11ce8445 (diff)
Bug fix: skip over signature if not wanted, return correct category of
file.
Diffstat (limited to 'usr.sbin/pkg_install')
-rw-r--r--usr.sbin/pkg_install/sign/gzip.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/usr.sbin/pkg_install/sign/gzip.c b/usr.sbin/pkg_install/sign/gzip.c
index 63f45ecf9f6..03132d83bf6 100644
--- a/usr.sbin/pkg_install/sign/gzip.c
+++ b/usr.sbin/pkg_install/sign/gzip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gzip.c,v 1.1 1999/09/27 21:40:04 espie Exp $ */
+/* $OpenBSD: gzip.c,v 1.2 1999/10/01 01:14:38 espie Exp $ */
/*-
* Copyright (c) 1999 Marc Espie.
*
@@ -28,6 +28,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/types.h>
+#include <sys/wait.h>
#include <stdio.h>
#include <string.h>
#include "stand.h"
@@ -95,12 +96,17 @@ gzip_read_header(f, h, sign)
return GZIP_SIGNED;
else
return GZIP_NOT_PGPSIGNED;
- } else
- return GZIP_UNSIGNED;
+ } else {
+ if (fseek(f, SIGNSIZE, SEEK_CUR) != -1)
+ return GZIP_SIGNED;
+ else
+ return GZIP_NOT_PGPSIGNED;
+ }
} else
return GZIP_UNSIGNED;
}
+/* write a gzip header, including PGP signature */
int
gzip_write_header(f, h, sign)
FILE *f;