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/create Pull up revisions 1.31-1.32...



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

description:
Pull up revisions 1.31-1.32 (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/create/perform.c |  43 ++++++++++++++--------------------
 1 files changed, 18 insertions(+), 25 deletions(-)

diffs (146 lines):

diff -r 68df341ec0f8 -r 4a9e80013b1a usr.sbin/pkg_install/create/perform.c
--- a/usr.sbin/pkg_install/create/perform.c     Fri Jun 28 12:43:23 2002 +0000
+++ b/usr.sbin/pkg_install/create/perform.c     Fri Jun 28 12:43:31 2002 +0000
@@ -1,11 +1,11 @@
-/*     $NetBSD: perform.c,v 1.30 2002/03/05 14:16:11 agc Exp $ */
+/*     $NetBSD: perform.c,v 1.30.2.1 2002/06/28 12:43:31 lukem Exp $   */
 
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static const char *rcsid = "from FreeBSD Id: perform.c,v 1.38 1997/10/13 15:03:51 jkh Exp";
 #else
-__RCSID("$NetBSD: perform.c,v 1.30 2002/03/05 14:16:11 agc Exp $");
+__RCSID("$NetBSD: perform.c,v 1.30.2.1 2002/06/28 12:43:31 lukem Exp $");
 #endif
 #endif
 
@@ -37,7 +37,7 @@
 #include <sys/wait.h>
 #include <unistd.h>
 
-static char *home;
+static char *Home;
 
 static void
 make_dist(char *home, char *pkg, char *suffix, package_t *plist)
@@ -196,7 +196,7 @@
                alreadyCleaning = 1;
                if (sig)
                        printf("Signal %d received, cleaning up.\n", sig);
-               leave_playpen(home);
+               leave_playpen(Home);
                if (sig)
                        exit(1);
        }
@@ -204,13 +204,6 @@
        signal(SIGHUP, oldhup);
 }
 
-static int
-note_whats_installed(const char *found, char *note)
-{
-       (void) strcpy(note, found);
-       return 0;
-}
-
 int
 pkg_perform(lpkg_head_t *pkgs)
 {
@@ -315,18 +308,18 @@
          * hack.  It's not a real create in progress.
          */
        if (PlistOnly) {
-               check_list(home, &plist, basename_of(pkg));
+               check_list(Home, &plist, basename_of(pkg));
                write_plist(&plist, stdout, realprefix);
                exit(0);
        }
 
        /* Make a directory to stomp around in */
-       home = make_playpen(PlayPen, PlayPenSize, 0);
+       Home = make_playpen(PlayPen, PlayPenSize, 0);
        signal(SIGINT, cleanup);
        signal(SIGHUP, cleanup);
 
        /* Make first "real contents" pass over it */
-       check_list(home, &plist, basename_of(pkg));
+       check_list(Home, &plist, basename_of(pkg));
        (void) umask(022);      /* make sure gen'ed directories, files
                                 * don't have group or other write bits. */
 
@@ -340,49 +333,49 @@
        add_plist(&plist, PLIST_FILE, DESC_FNAME);
 
        if (Install) {
-               copy_file(home, Install, INSTALL_FNAME);
+               copy_file(Home, Install, INSTALL_FNAME);
                add_plist(&plist, PLIST_IGNORE, NULL);
                add_plist(&plist, PLIST_FILE, INSTALL_FNAME);
        }
        if (DeInstall) {
-               copy_file(home, DeInstall, DEINSTALL_FNAME);
+               copy_file(Home, DeInstall, DEINSTALL_FNAME);
                add_plist(&plist, PLIST_IGNORE, NULL);
                add_plist(&plist, PLIST_FILE, DEINSTALL_FNAME);
        }
        if (Require) {
-               copy_file(home, Require, REQUIRE_FNAME);
+               copy_file(Home, Require, REQUIRE_FNAME);
                add_plist(&plist, PLIST_IGNORE, NULL);
                add_plist(&plist, PLIST_FILE, REQUIRE_FNAME);
        }
        if (Display) {
-               copy_file(home, Display, DISPLAY_FNAME);
+               copy_file(Home, Display, DISPLAY_FNAME);
                add_plist(&plist, PLIST_IGNORE, NULL);
                add_plist(&plist, PLIST_FILE, DISPLAY_FNAME);
                add_plist(&plist, PLIST_DISPLAY, DISPLAY_FNAME);
        }
        if (Mtree) {
-               copy_file(home, Mtree, MTREE_FNAME);
+               copy_file(Home, Mtree, MTREE_FNAME);
                add_plist(&plist, PLIST_IGNORE, NULL);
                add_plist(&plist, PLIST_FILE, MTREE_FNAME);
                add_plist(&plist, PLIST_MTREE, MTREE_FNAME);
        }
        if (BuildVersion) {
-               copy_file(home, BuildVersion, BUILD_VERSION_FNAME);
+               copy_file(Home, BuildVersion, BUILD_VERSION_FNAME);
                add_plist(&plist, PLIST_IGNORE, NULL);
                add_plist(&plist, PLIST_FILE, BUILD_VERSION_FNAME);
        }
        if (BuildInfo) {
-               copy_file(home, BuildInfo, BUILD_INFO_FNAME);
+               copy_file(Home, BuildInfo, BUILD_INFO_FNAME);
                add_plist(&plist, PLIST_IGNORE, NULL);
                add_plist(&plist, PLIST_FILE, BUILD_INFO_FNAME);
        }
        if (SizePkg) {
-               copy_file(home, SizePkg, SIZE_PKG_FNAME);
+               copy_file(Home, SizePkg, SIZE_PKG_FNAME);
                add_plist(&plist, PLIST_IGNORE, NULL);
                add_plist(&plist, PLIST_FILE, SIZE_PKG_FNAME);
        }
        if (SizeAll) {
-               copy_file(home, SizeAll, SIZE_ALL_FNAME);
+               copy_file(Home, SizeAll, SIZE_ALL_FNAME);
                add_plist(&plist, PLIST_IGNORE, NULL);
                add_plist(&plist, PLIST_FILE, SIZE_ALL_FNAME);
        }
@@ -400,13 +393,13 @@
        }
 
        /* And stick it into a tar ball */
-       make_dist(home, pkg, suffix, &plist);
+       make_dist(Home, pkg, suffix, &plist);
 
        /* Cleanup */
        free(Comment);
        free(Desc);
        free_plist(&plist);
-       leave_playpen(home);
+       leave_playpen(Home);
        
        return TRUE;            /* Success */
 }



Home | Main Index | Thread Index | Old Index