Source-Changes-HG archive

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

[src/netbsd-1-6]: src/usr.sbin/pkg_install/add Pull up revision 1.3 (requeste...



details:   https://anonhg.NetBSD.org/src/rev/f059031748fc
branches:  netbsd-1-6
changeset: 528261:f059031748fc
user:      lukem <lukem%NetBSD.org@localhost>
date:      Fri Jun 28 12:43:06 2002 +0000

description:
Pull up revision 1.3 (requested by taca in ticket #369):
- fix buffer size checks
- define PKG_PATTEN_MAX and PKG_SUFFIX_MAX and
  use them instead of constants like 255.
- add asserts and buffer size checks.
- constify and make WARNS=2 clean.
- Fixes provided by Stoned Elipot <seb%script.jussieu.fr@localhost> in PR 17323

diffstat:

 usr.sbin/pkg_install/add/verify.c |  14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diffs (58 lines):

diff -r 264f57215b83 -r f059031748fc usr.sbin/pkg_install/add/verify.c
--- a/usr.sbin/pkg_install/add/verify.c Fri Jun 28 12:42:58 2002 +0000
+++ b/usr.sbin/pkg_install/add/verify.c Fri Jun 28 12:43:06 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: verify.c,v 1.2 2001/09/25 11:42:56 agc Exp $ */
+/* $NetBSD: verify.c,v 1.2.4.1 2002/06/28 12:43:06 lukem Exp $ */
 
 /*
  * Copyright (c) 2001 Alistair G. Crooks.  All rights reserved.
@@ -35,7 +35,7 @@
 #ifndef lint
 __COPYRIGHT("@(#) Copyright (c) 1999 \
                The NetBSD Foundation, Inc.  All rights reserved.");
-__RCSID("$NetBSD: verify.c,v 1.2 2001/09/25 11:42:56 agc Exp $");
+__RCSID("$NetBSD: verify.c,v 1.2.4.1 2002/06/28 12:43:06 lukem Exp $");
 #endif
 
 #include <sys/types.h>
@@ -65,10 +65,10 @@
 
 /* called when gpg verification type is selected */
 static int
-do_verify(const char *pkgname, const char *cmd, const char **extensions)
+do_verify(const char *pkgname, const char *cmd, const char *const *extensions)
 {
        struct stat     st;
-       const char    **ep;
+       const char    *const *ep;
        char            buf[BUFSIZ];
        char            f[FILENAME_MAX];
        int             i;
@@ -104,7 +104,7 @@
 }
 
 /* table holding possible verifications which can be made */
-static ver_t   vertab[] = {
+static const ver_t     vertab[] = {
        { "none",       NULL,                   { NULL } },
        { "gpg",        "gpg --verify %s",      { ".sig", ".asc", NULL } },
        { "pgp5",       "pgpv %s",              { ".sig", ".asc", ".pgp", NULL } },
@@ -125,7 +125,7 @@
 char *
 get_verification(void)
 {
-       ver_t  *vp;
+       const ver_t *vp;
 
        if (verification_type != NULL) {
                for (vp = vertab ; vp->name ; vp++) {
@@ -141,7 +141,7 @@
 int
 verify(const char *pkg)
 {
-       ver_t   *vp;
+       const ver_t *vp;
 
        if (verification_type == NULL) {
                return do_verify(pkg, NULL, NULL);



Home | Main Index | Thread Index | Old Index