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/info Pull up revisions 1.38-1.39 (...



details:   https://anonhg.NetBSD.org/src/rev/25ce168e39f1
branches:  netbsd-1-6
changeset: 528270:25ce168e39f1
user:      lukem <lukem%NetBSD.org@localhost>
date:      Fri Jun 28 12:44:23 2002 +0000

description:
Pull up revisions 1.38-1.39 (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/info/perform.c |  15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diffs (57 lines):

diff -r 4994c0361f16 -r 25ce168e39f1 usr.sbin/pkg_install/info/perform.c
--- a/usr.sbin/pkg_install/info/perform.c       Fri Jun 28 12:44:14 2002 +0000
+++ b/usr.sbin/pkg_install/info/perform.c       Fri Jun 28 12:44:23 2002 +0000
@@ -1,11 +1,11 @@
-/*     $NetBSD: perform.c,v 1.37 2001/03/10 18:41:45 wiz Exp $ */
+/*     $NetBSD: perform.c,v 1.37.2.1 2002/06/28 12:44:23 lukem Exp $   */
 
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static const char *rcsid = "from FreeBSD Id: perform.c,v 1.23 1997/10/13 15:03:53 jkh Exp";
 #else
-__RCSID("$NetBSD: perform.c,v 1.37 2001/03/10 18:41:45 wiz Exp $");
+__RCSID("$NetBSD: perform.c,v 1.37.2.1 2002/06/28 12:44:23 lukem Exp $");
 #endif
 #endif
 
@@ -130,7 +130,7 @@
                                char    try[FILENAME_MAX];
                                snprintf(try, FILENAME_MAX, "%s-[0-9]*", pkg);
                                if (findmatchingname(_pkgdb_getPKGDB_DIR(), try,
-                                       find_fn, NULL) != 0) {
+                                       add_to_list_fn, &pkgs) != 0) {
                                        return 0;       /* we've just appended some names to the pkgs list,
                                                         * they will be processed after this package. */
                                }
@@ -240,8 +240,9 @@
  * Function to be called for pkgs found
  */
 static int
-foundpkg(const char *found, char *data)
+foundpkg(const char *found, void *vp)
 {
+       char *data = vp;
        char buf[FILENAME_MAX+1];
 
        /* we only want to display this if it really is a directory */
@@ -299,7 +300,7 @@
 }
 
 int
-pkg_perform(lpkg_head_t *pkgs)
+pkg_perform(lpkg_head_t *pkghead)
 {
        struct dirent *dp;
        char   *tmp;
@@ -354,8 +355,8 @@
                /* Show info on individual pkg(s) */
                lpkg_t *lpp;
 
-               while ((lpp = TAILQ_FIRST(pkgs))) {
-                       TAILQ_REMOVE(pkgs, lpp, lp_link);
+               while ((lpp = TAILQ_FIRST(pkghead))) {
+                       TAILQ_REMOVE(pkghead, lpp, lp_link);
                        err_cnt += pkg_do(lpp->lp_name);
                        free_lpkg(lpp);
                }



Home | Main Index | Thread Index | Old Index