summaryrefslogtreecommitdiff
path: root/pkgtools/pkg_install/files/add
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2007-09-11 13:46:10 +0000
committerrillig <rillig@pkgsrc.org>2007-09-11 13:46:10 +0000
commitd091934e69a56fc8b64067f75b188f40ddb031de (patch)
treea3227ef674f017127d67bf63304968f525e4b356 /pkgtools/pkg_install/files/add
parent6a27b7d10c0e1189f5c28900826c9be17b470184 (diff)
downloadpkgsrc-d091934e69a56fc8b64067f75b188f40ddb031de.tar.gz
Replaced undefined behavior with an error message. We don't expect
absolute paths in the PLIST anyway.
Diffstat (limited to 'pkgtools/pkg_install/files/add')
-rw-r--r--pkgtools/pkg_install/files/add/extract.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/pkgtools/pkg_install/files/add/extract.c b/pkgtools/pkg_install/files/add/extract.c
index beb329869f7..9bfb3b678f6 100644
--- a/pkgtools/pkg_install/files/add/extract.c
+++ b/pkgtools/pkg_install/files/add/extract.c
@@ -1,4 +1,4 @@
-/* $NetBSD: extract.c,v 1.15 2007/04/16 12:55:35 joerg Exp $ */
+/* $NetBSD: extract.c,v 1.16 2007/09/11 13:46:10 rillig Exp $ */
#if HAVE_CONFIG_H
#include "config.h"
@@ -14,7 +14,7 @@
#if 0
static const char *rcsid = "FreeBSD - Id: extract.c,v 1.17 1997/10/08 07:45:35 charnier Exp";
#else
-__RCSID("$NetBSD: extract.c,v 1.15 2007/04/16 12:55:35 joerg Exp $");
+__RCSID("$NetBSD: extract.c,v 1.16 2007/09/11 13:46:10 rillig Exp $");
#endif
#endif
@@ -256,16 +256,15 @@ extract_plist(char *home, package_t *pkg)
* that would probably affect too much code I prefer
* not to touch - HF */
- char *s, t[MaxPathSize], *u;
+ char *s, t[MaxPathSize];
int rc;
LFILE_ADD(&files, lfp, p->name);
LFILE_ADD(&perms, lfp, p->name);
if (p->name[0] == '/')
- u = p->name;
+ errx(EXIT_FAILURE, "File names must not be absolute (%s).", p->name);
else {
(void) snprintf(t, sizeof(t), "%s/%s", Directory, p->name);
- u = t;
}
s = pkgdb_retrieve(t);