diff options
author | wiz <wiz> | 2006-04-04 06:24:39 +0000 |
---|---|---|
committer | wiz <wiz> | 2006-04-04 06:24:39 +0000 |
commit | 8f4e607190418bdd43a0c24ff01bdcdb56c3a7eb (patch) | |
tree | d9e67f2507b4c855d4ec380c6987256651d07a77 /pkgtools | |
parent | 65d4fd985e6efd818b6b4da690f48583a5eee010 (diff) | |
download | pkgsrc-8f4e607190418bdd43a0c24ff01bdcdb56c3a7eb.tar.gz |
Pull over 1.117 from src/usr.sbin:
revision 1.117
date: 2006/03/17 02:37:31; author: hubertf; state: Exp; lines: +6 -2
Add sanity check if there's a @cwd in the +CONTENT file.
If not abort, because we wouldn't know where to put the files.
Coverity CID 1358
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pkg_install/files/add/perform.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pkgtools/pkg_install/files/add/perform.c b/pkgtools/pkg_install/files/add/perform.c index 71cdf6fabf4..334f0979249 100644 --- a/pkgtools/pkg_install/files/add/perform.c +++ b/pkgtools/pkg_install/files/add/perform.c @@ -1,4 +1,4 @@ -/* $NetBSD: perform.c,v 1.38 2006/03/13 22:08:22 erh Exp $ */ +/* $NetBSD: perform.c,v 1.39 2006/04/04 06:24:39 wiz Exp $ */ #if HAVE_CONFIG_H #include "config.h" @@ -14,7 +14,7 @@ #if 0 static const char *rcsid = "from FreeBSD Id: perform.c,v 1.44 1997/10/13 15:03:46 jkh Exp"; #else -__RCSID("$NetBSD: perform.c,v 1.38 2006/03/13 22:08:22 erh Exp $"); +__RCSID("$NetBSD: perform.c,v 1.39 2006/04/04 06:24:39 wiz Exp $"); #endif #endif @@ -500,6 +500,10 @@ pkg_do(const char *pkg, lpkg_head_t *pkgs) */ if (is_depoted_pkg) { p = find_plist(&Plist, PLIST_CWD); + if (p == NULL) { + warn("no @cwd in +CONTENTS file?! aborting."); + goto bomb; + } (void) strlcpy(dbdir, dirname_of(p->name), sizeof(dbdir)); (void) strlcpy(LogDir, p->name, sizeof(LogDir)); } else { |