Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-8]: src/external/bsd/pkg_install/dist Pull up the following revis...



details:   https://anonhg.NetBSD.org/src/rev/9436fa93f794
branches:  netbsd-8
changeset: 460402:9436fa93f794
user:      martin <martin%NetBSD.org@localhost>
date:      Mon Oct 21 16:57:40 2019 +0000

description:
Pull up the following revisions, requested by joerg in ticket #1409:

        external/bsd/pkg_install/dist/add/perform.c     up to 1.6
        external/bsd/pkg_install/dist/add/pkg_add.1     up to 1.3
        external/bsd/pkg_install/dist/admin/audit.c     up to 1.3
        external/bsd/pkg_install/dist/admin/main.c      up to 1.4
        external/bsd/pkg_install/dist/admin/pkg_admin.1 up to 1.5
        external/bsd/pkg_install/dist/create/util.c     up to 1.2
        external/bsd/pkg_install/dist/delete/pkg_delete.c up to 1.3
        external/bsd/pkg_install/dist/info/main.c       up to 1.3
        external/bsd/pkg_install/dist/lib/lib.h         up to 1.9
        external/bsd/pkg_install/dist/lib/license.c     up to 1.9
        external/bsd/pkg_install/dist/lib/parse-config.c up to 1.3
        external/bsd/pkg_install/dist/lib/pkcs7.c       up to 1.4
        external/bsd/pkg_install/dist/lib/pkg_io.c      up to 1.3
        external/bsd/pkg_install/dist/lib/version.h     up to 1.15
        external/bsd/pkg_install/dist/lib/vulnerabilities-file.c up to 1.3

Merge pkg_install-20191008 from pkgsrc.

diffstat:

 external/bsd/pkg_install/dist/add/perform.c              |   6 +-
 external/bsd/pkg_install/dist/add/pkg_add.1              |  18 +++--
 external/bsd/pkg_install/dist/admin/audit.c              |  13 +++-
 external/bsd/pkg_install/dist/admin/main.c               |  37 +++++++++++--
 external/bsd/pkg_install/dist/admin/pkg_admin.1          |  44 +++++++++------
 external/bsd/pkg_install/dist/create/util.c              |  15 ++--
 external/bsd/pkg_install/dist/delete/pkg_delete.c        |   4 +-
 external/bsd/pkg_install/dist/info/main.c                |  16 +++--
 external/bsd/pkg_install/dist/lib/lib.h                  |   4 +-
 external/bsd/pkg_install/dist/lib/license.c              |  10 ++-
 external/bsd/pkg_install/dist/lib/parse-config.c         |   6 +-
 external/bsd/pkg_install/dist/lib/pkcs7.c                |  38 ++++---------
 external/bsd/pkg_install/dist/lib/pkg_io.c               |   5 +-
 external/bsd/pkg_install/dist/lib/version.h              |   4 +-
 external/bsd/pkg_install/dist/lib/vulnerabilities-file.c |  19 ++++--
 15 files changed, 140 insertions(+), 99 deletions(-)

diffs (truncated from 729 to 300 lines):

diff -r f426844f116d -r 9436fa93f794 external/bsd/pkg_install/dist/add/perform.c
--- a/external/bsd/pkg_install/dist/add/perform.c       Thu Oct 17 18:41:27 2019 +0000
+++ b/external/bsd/pkg_install/dist/add/perform.c       Mon Oct 21 16:57:40 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: perform.c,v 1.5 2017/04/20 13:18:23 joerg Exp $        */
+/*     $NetBSD: perform.c,v 1.5.4.1 2019/10/21 16:57:40 martin 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.5 2017/04/20 13:18:23 joerg Exp $");
+__RCSID("$NetBSD: perform.c,v 1.5.4.1 2019/10/21 16:57:40 martin Exp $");
 
 /*-
  * Copyright (c) 2003 Grant Beattie <grant%NetBSD.org@localhost>
@@ -1318,7 +1318,7 @@
                        return require_check;
        }
 
-       if (!audit_package(pv, pkg->pkgname, NULL, 2))
+       if (!audit_package(pv, pkg->pkgname, NULL, 0, 2))
                return 0;
 
        if (require_check)
diff -r f426844f116d -r 9436fa93f794 external/bsd/pkg_install/dist/add/pkg_add.1
--- a/external/bsd/pkg_install/dist/add/pkg_add.1       Thu Oct 17 18:41:27 2019 +0000
+++ b/external/bsd/pkg_install/dist/add/pkg_add.1       Mon Oct 21 16:57:40 2019 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: pkg_add.1,v 1.2 2017/04/20 13:18:23 joerg Exp $
+.\" $NetBSD: pkg_add.1,v 1.2.4.1 2019/10/21 16:57:40 martin Exp $
 .\"
 .\" FreeBSD install - a package for the installation and maintenance
 .\" of non-core utilities.
@@ -17,7 +17,7 @@
 .\"
 .\"     @(#)pkg_add.1
 .\"
-.Dd December 27, 2014
+.Dd March 21, 2018
 .Dt PKG_ADD 1
 .Os
 .Sh NAME
@@ -25,7 +25,7 @@
 .Nd a utility for installing and upgrading software package distributions
 .Sh SYNOPSIS
 .Nm
-.Op Fl AfInRUuVv
+.Op Fl AfhInRUuVv
 .Op Fl C Ar config
 .Op Fl K Ar pkg_dbdir
 .Op Fl m Ar machine
@@ -119,6 +119,11 @@
 Read the configuration file from
 .Ar config
 instead of the system default.
+.It Fl D
+Force updating even if the dependencies of depending packages are not
+satisfied by the new package.
+This is used by "make replace", after which one would typically
+replace the depending packages.
 .It Fl f
 Force installation to proceed even if prerequisite packages are not
 installed or the install script fails.
@@ -128,11 +133,8 @@
 a failure to find one will not be fatal.
 This flag also overrides the fatal error when the operating system or
 architecture the package was built on differ from that of the host.
-.It Fl D
-Force updating even if the dependencies of depending packages are not
-satisfied by the new package.
-This is used by "make replace", after which one would typically
-replace the depending packages.
+.It Fl h
+Display help and exit.
 .It Fl I
 If an installation script exists for a given package, do not execute it.
 .It Fl K Ar pkg_dbdir
diff -r f426844f116d -r 9436fa93f794 external/bsd/pkg_install/dist/admin/audit.c
--- a/external/bsd/pkg_install/dist/admin/audit.c       Thu Oct 17 18:41:27 2019 +0000
+++ b/external/bsd/pkg_install/dist/admin/audit.c       Mon Oct 21 16:57:40 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: audit.c,v 1.2 2017/04/20 13:18:23 joerg Exp $  */
+/*     $NetBSD: audit.c,v 1.2.4.1 2019/10/21 16:57:40 martin 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.2 2017/04/20 13:18:23 joerg Exp $");
+__RCSID("$NetBSD: audit.c,v 1.2.4.1 2019/10/21 16:57:40 martin Exp $");
 
 /*-
  * Copyright (c) 2008 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
@@ -73,13 +73,14 @@
 #include "admin.h"
 #include "lib.h"
 
+static int check_ignored_advisories = 0;
 static int check_signature = 0;
 static const char *limit_vul_types = NULL;
 static int update_pkg_vuln = 0;
 
 static struct pkg_vulnerabilities *pv;
 
-static const char audit_options[] = "est:";
+static const char audit_options[] = "eist:";
 
 static void
 parse_options(int argc, char **argv, const char *options)
@@ -101,6 +102,9 @@
                case 'e':
                        check_eol = "yes";
                        break;
+               case 'i':
+                       check_ignored_advisories = 1;
+                       break;
                case 's':
                        check_signature = 1;
                        break;
@@ -122,7 +126,8 @@
 static int
 check_exact_pkg(const char *pkg)
 {
-       return audit_package(pv, pkg, limit_vul_types, quiet ? 0 : 1);
+       return audit_package(pv, pkg, limit_vul_types,
+                            check_ignored_advisories, quiet ? 0 : 1);
 }
 
 static int
diff -r f426844f116d -r 9436fa93f794 external/bsd/pkg_install/dist/admin/main.c
--- a/external/bsd/pkg_install/dist/admin/main.c        Thu Oct 17 18:41:27 2019 +0000
+++ b/external/bsd/pkg_install/dist/admin/main.c        Mon Oct 21 16:57:40 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.2 2017/04/20 13:18:23 joerg Exp $   */
+/*     $NetBSD: main.c,v 1.2.4.1 2019/10/21 16:57:40 martin Exp $      */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -7,10 +7,10 @@
 #if HAVE_SYS_CDEFS_H
 #include <sys/cdefs.h>
 #endif
-__RCSID("$NetBSD: main.c,v 1.2 2017/04/20 13:18:23 joerg Exp $");
+__RCSID("$NetBSD: main.c,v 1.2.4.1 2019/10/21 16:57:40 martin Exp $");
 
 /*-
- * Copyright (c) 1999-2009 The NetBSD Foundation, Inc.
+ * Copyright (c) 1999-2019 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -59,8 +59,10 @@
 #endif
 #ifndef NETBSD
 #include <nbcompat/md5.h>
+#include <nbcompat/sha2.h>
 #else
 #include <md5.h>
+#include <sha2.h>
 #endif
 #if HAVE_LIMITS_H
 #include <limits.h>
@@ -93,6 +95,7 @@
 int    quiet, verbose;
 
 static void set_unset_variable(char **, Boolean);
+static void digest_input(char **);
 
 /* print usage message and exit */
 void 
@@ -112,9 +115,9 @@
            " pmatch pattern pkg          - returns true if pkg matches pattern, otherwise false\n"
            " fetch-pkg-vulnerabilities [-s] - fetch new vulnerability file\n"
            " check-pkg-vulnerabilities [-s] <file> - check syntax and checksums of the vulnerability file\n"
-           " audit [-es] [-t type] ...       - check installed packages for vulnerabilities\n"
-           " audit-pkg [-es] [-t type] ...   - check listed packages for vulnerabilities\n"
-           " audit-batch [-es] [-t type] ... - check packages in listed files for vulnerabilities\n"
+           " audit [-eis] [-t type] ...       - check installed packages for vulnerabilities\n"
+           " audit-pkg [-eis] [-t type] ...   - check listed packages for vulnerabilities\n"
+           " audit-batch [-eis] [-t type] ... - check packages in listed files for vulnerabilities\n"
            " audit-history [-t type] ...     - print all advisories for package names\n"
            " check-license <condition>       - check if condition is acceptable\n"
            " check-single-license <license>  - check if license is acceptable\n"
@@ -521,6 +524,9 @@
        } else if (strcasecmp(argv[0], "unset") == 0) {
                argv++;         /* "unset" */
                set_unset_variable(argv, TRUE);
+       } else if (strcasecmp(argv[0], "digest") == 0) {
+               argv++;         /* "digest" */
+               digest_input(argv);
        } else if (strcasecmp(argv[0], "config-var") == 0) {
                argv++;
                if (argv == NULL || argv[1] != NULL)
@@ -736,3 +742,22 @@
 
        return;
 }
+
+static void
+digest_input(char **argv)
+{
+       char digest[SHA256_DIGEST_STRING_LENGTH];
+       int failures = 0;
+
+       while (*argv != NULL) {
+               if (SHA256_File(*argv, digest)) {
+                       puts(digest);
+               } else {
+                       warn("cannot process %s", *argv);
+                       ++failures;
+               }
+               argv++;
+       }
+       if (failures)
+               exit(EXIT_FAILURE);
+}
diff -r f426844f116d -r 9436fa93f794 external/bsd/pkg_install/dist/admin/pkg_admin.1
--- a/external/bsd/pkg_install/dist/admin/pkg_admin.1   Thu Oct 17 18:41:27 2019 +0000
+++ b/external/bsd/pkg_install/dist/admin/pkg_admin.1   Mon Oct 21 16:57:40 2019 +0000
@@ -1,10 +1,11 @@
-.\"    $NetBSD: pkg_admin.1,v 1.2 2017/04/20 13:18:23 joerg Exp $
+.\"    $NetBSD: pkg_admin.1,v 1.2.4.1 2019/10/21 16:57:40 martin Exp $
 .\"
-.\" Copyright (c) 1999-2010 The NetBSD Foundation, Inc.
+.\" Copyright (c) 1999-2019 The NetBSD Foundation, Inc.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to The NetBSD Foundation
-.\" by Hubert Feyrer <hubert%feyrer.de@localhost>.
+.\" by Hubert Feyrer <hubert%feyrer.de@localhost> and
+.\" by Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
 .\" modification, are permitted provided that the following conditions
@@ -14,13 +15,6 @@
 .\" 2. Redistributions in binary form must reproduce the above copyright
 .\"    notice, this list of conditions and the following disclaimer in the
 .\"    documentation and/or other materials provided with the distribution.
-.\" 3. All advertising materials mentioning features or use of this software
-.\"    must display the following acknowledgement:
-.\"        This product includes software developed by the NetBSD
-.\"        Foundation, Inc. and its contributors.
-.\" 4. Neither the name of The NetBSD Foundation nor the names of its
-.\"    contributors may be used to endorse or promote products derived
-.\"    from this software without specific prior written permission.
 .\"
 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
@@ -34,7 +28,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd December 27, 2014
+.Dd October 8, 2019
 .Dt PKG_ADMIN 1
 .Os
 .Sh NAME
@@ -106,7 +100,7 @@
 .Pp
 The following commands are supported:
 .Bl -tag -width indent
-.It Cm audit Oo Fl es Oc Oo Fl t Ar type Oc Oo Ar pkg Oc ...
+.It Cm audit Oo Fl eis Oc Oo Fl t Ar type Oc Oo Ar pkg Oc ...
 Check the listed installed packages for vulnerabilities.
 If no package is given, check all installed packages.
 If
@@ -118,16 +112,25 @@
 with
 .Qq Li yes .
 If
+.Fl i
+is given,
+any advisory ignored by
+.Dv IGNORE_URL
+in
+.Xr pkg_install.conf 5
+is included but flagged as
+.Qq ignored .
+If
 .Fl s
 is given, check the signature of the pkg-vulnerabilities file before using it.
 .Fl t
 restricts the reported vulnerabilities to type
 .Ar type .
-.It Cm audit-pkg Oo Fl es Oc Oo Fl t Ar type Oc Oo Ar pkg Oc ...
+.It Cm audit-pkg Oo Fl eis Oc Oo Fl t Ar type Oc Oo Ar pkg Oc ...
 Like
 .Cm audit ,
 but check only the given package names or patterns.
-.It Cm audit-batch Oo Fl es Oc Oo Fl t Ar type Oc Oo Ar pkg-list Oc ...
+.It Cm audit-batch Oo Fl eis Oc Oo Fl t Ar type Oc Oo Ar pkg-list Oc ...
 Like
 .Cm audit-pkg ,
 but read the package names or patterns one per line from the given files.
@@ -180,6 +183,9 @@



Home | Main Index | Thread Index | Old Index