diff options
author | joerg <joerg@pkgsrc.org> | 2010-04-14 18:24:58 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2010-04-14 18:24:58 +0000 |
commit | 0447709a57d8dc1616b2ff998ad27c64ead6906b (patch) | |
tree | f15fffc4b32aedcf2f3552c212993aacadb7a846 /pkgtools/pkg_install/files/admin | |
parent | 6891d402e90bfcbfd323f50e310eadf81577975d (diff) | |
download | pkgsrc-0447709a57d8dc1616b2ff998ad27c64ead6906b.tar.gz |
pkg_install-20100405:
- Try to detect common forms of pkgdb corruption and issue a warning in
that case.
- Refactor the pkg_vulnerabilities logic to use the compression support
from libarchive. This reduces the amount zlib/bzip2 interaction to the
linkage.
Diffstat (limited to 'pkgtools/pkg_install/files/admin')
-rw-r--r-- | pkgtools/pkg_install/files/admin/audit.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/pkgtools/pkg_install/files/admin/audit.c b/pkgtools/pkg_install/files/admin/audit.c index 2d7c9332cef..c23ed42064c 100644 --- a/pkgtools/pkg_install/files/admin/audit.c +++ b/pkgtools/pkg_install/files/admin/audit.c @@ -1,4 +1,4 @@ -/* $NetBSD: audit.c,v 1.14 2009/08/02 17:56:44 joerg Exp $ */ +/* $NetBSD: audit.c,v 1.15 2010/04/14 18:24:58 joerg Exp $ */ #if HAVE_CONFIG_H #include "config.h" @@ -7,7 +7,7 @@ #if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> #endif -__RCSID("$NetBSD: audit.c,v 1.14 2009/08/02 17:56:44 joerg Exp $"); +__RCSID("$NetBSD: audit.c,v 1.15 2010/04/14 18:24:58 joerg Exp $"); /*- * Copyright (c) 2008 Joerg Sonnenberger <joerg@NetBSD.org>. @@ -209,7 +209,7 @@ check_and_read_pkg_vulnerabilities(void) (long)(now / 86400), now / 86400 == 1 ? "" : "s"); } - pv = read_pkg_vulnerabilities(pkg_vulnerabilities_file, 0, check_signature); + pv = read_pkg_vulnerabilities_file(pkg_vulnerabilities_file, 0, check_signature); } void @@ -282,7 +282,7 @@ check_pkg_vulnerabilities(int argc, char **argv) if (argc != optind + 1) usage(); - pv = read_pkg_vulnerabilities(argv[optind], 0, check_signature); + pv = read_pkg_vulnerabilities_file(argv[optind], 0, check_signature); free_pkg_vulnerabilities(pv); } @@ -290,8 +290,8 @@ void fetch_pkg_vulnerabilities(int argc, char **argv) { struct pkg_vulnerabilities *pv_check; - char *buf, *decompressed_input; - size_t buf_len, buf_fetched, decompressed_len; + char *buf; + size_t buf_len, buf_fetched; ssize_t cur_fetched; struct url *url; struct url_stat st; @@ -363,15 +363,7 @@ fetch_pkg_vulnerabilities(int argc, char **argv) buf[buf_len] = '\0'; - if (decompress_buffer(buf, buf_len, &decompressed_input, - &decompressed_len)) { - pv_check = parse_pkg_vulnerabilities(decompressed_input, - decompressed_len, check_signature); - free(decompressed_input); - } else { - pv_check = parse_pkg_vulnerabilities(buf, buf_len, - check_signature); - } + pv_check = read_pkg_vulnerabilities_memory(buf, buf_len, check_signature); free_pkg_vulnerabilities(pv_check); fd = open(pkg_vulnerabilities_file, O_WRONLY | O_CREAT | O_TRUNC, 0644); |