pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/pkg_install-renovation]: pkgsrc/pkgtools/pkg_install/files/add Also i...
details: https://anonhg.NetBSD.org/pkgsrc/rev/d55954ae6235
branches: pkg_install-renovation
changeset: 541612:d55954ae6235
user: joerg <joerg%pkgsrc.org@localhost>
date: Thu Jan 08 00:04:53 2009 +0000
description:
Also include support for IGNORE_URL.
diffstat:
pkgtools/pkg_install/files/add/perform.c | 33 ++++++++++++++++++++++++++++++-
1 files changed, 31 insertions(+), 2 deletions(-)
diffs (61 lines):
diff -r 7b75a59a067b -r d55954ae6235 pkgtools/pkg_install/files/add/perform.c
--- a/pkgtools/pkg_install/files/add/perform.c Thu Jan 08 00:01:30 2009 +0000
+++ b/pkgtools/pkg_install/files/add/perform.c Thu Jan 08 00:04:53 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: perform.c,v 1.70.4.20 2009/01/08 00:01:30 joerg Exp $ */
+/* $NetBSD: perform.c,v 1.70.4.21 2009/01/08 00:04:53 joerg Exp $ */
#if HAVE_CONFIG_H
#include "config.h"
#endif
@@ -6,7 +6,7 @@
#if HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
#endif
-__RCSID("$NetBSD: perform.c,v 1.70.4.20 2009/01/08 00:01:30 joerg Exp $");
+__RCSID("$NetBSD: perform.c,v 1.70.4.21 2009/01/08 00:04:53 joerg Exp $");
/*-
* Copyright (c) 2003 Grant Beattie <grant%NetBSD.org@localhost>
@@ -1170,6 +1170,33 @@
}
static int
+check_ignored_entry(struct pkg_vulnerabilities *pv, size_t i)
+{
+ const char *iter, *next;
+ size_t entry_len, url_len;
+
+ if (ignore_advisories == NULL)
+ return 0;
+
+ url_len = strlen(pv->advisory[i]);
+
+ for (iter = ignore_advisories; *iter; iter = next) {
+ if ((next = strchr(iter, '\n')) == NULL) {
+ entry_len = strlen(iter);
+ next = iter + entry_len;
+ } else {
+ entry_len = next - iter;
+ ++next;
+ }
+ if (url_len != entry_len)
+ continue;
+ if (strncmp(pv->advisory[i], iter, entry_len) == 0)
+ return 1;
+ }
+ return 0;
+}
+
+static int
check_vulnerable(struct pkg_task *pkg)
{
static struct pkg_vulnerabilities *pv;
@@ -1198,6 +1225,8 @@
}
for (i = 0; i < pv->entries; ++i) {
+ if (check_ignored_entry(pv, i))
+ continue;
if (!pkg_match(pv->vulnerability[i], pkg->pkgname))
continue;
if (strcmp("eol", pv->classification[i]) == 0)
Home |
Main Index |
Thread Index |
Old Index