use full pathname of tar consistentlc
Patch provided in PR 14072 by Stoned Elipot <seb@script.jussieu.fr>
This commit is contained in:
parent
f0cf28bfaa
commit
384aae98cc
@ -1,11 +1,11 @@
|
||||
/* $NetBSD: extract.c,v 1.22 2000/07/24 20:09:15 dmcmahill Exp $ */
|
||||
/* $NetBSD: extract.c,v 1.23 2001/09/26 13:48:27 hubertf Exp $ */
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
#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.22 2000/07/24 20:09:15 dmcmahill Exp $");
|
||||
__RCSID("$NetBSD: extract.c,v 1.23 2001/09/26 13:48:27 hubertf Exp $");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -34,7 +34,7 @@ __RCSID("$NetBSD: extract.c,v 1.22 2000/07/24 20:09:15 dmcmahill Exp $");
|
||||
#include "add.h"
|
||||
|
||||
#define TAR_ARGS " cf - "
|
||||
#define TARX_CMD "|" TAR_CMD " xf - -C "
|
||||
#define TARX_CMD "|" TAR_FULLPATHNAME " xf - -C "
|
||||
|
||||
/*
|
||||
* This macro is used to determine if the 'where_args' buffer is big enough to add the
|
||||
@ -50,16 +50,16 @@ __RCSID("$NetBSD: extract.c,v 1.22 2000/07/24 20:09:15 dmcmahill Exp $");
|
||||
|| (strlen(str) + 3 + perm_count >= maxargs))
|
||||
|
||||
#define PUSHOUT(todir) /* push out string */ \
|
||||
if (where_count > sizeof(TAR_CMD) + sizeof(TAR_ARGS)-1) { \
|
||||
if (where_count > sizeof(TAR_FULLPATHNAME) + sizeof(TAR_ARGS)-1) { \
|
||||
strcat(where_args, TARX_CMD); \
|
||||
strcat(where_args, todir); \
|
||||
if (system(where_args)) { \
|
||||
cleanup(0); \
|
||||
errx(2, "can not invoke %lu byte %s pipeline: %s", \
|
||||
(u_long)strlen(where_args), TAR_CMD, \
|
||||
(u_long)strlen(where_args), TAR_FULLPATHNAME, \
|
||||
where_args); \
|
||||
} \
|
||||
strcpy(where_args, TAR_CMD TAR_ARGS); \
|
||||
strcpy(where_args, TAR_FULLPATHNAME TAR_ARGS); \
|
||||
where_count = strlen(where_args); \
|
||||
} \
|
||||
if (perm_count) { \
|
||||
@ -118,7 +118,7 @@ extract_plist(char *home, package_t *pkg)
|
||||
cleanup(0);
|
||||
errx(2, "can't get argument list space");
|
||||
}
|
||||
strcpy(where_args, TAR_CMD TAR_ARGS);
|
||||
strcpy(where_args, TAR_FULLPATHNAME TAR_ARGS);
|
||||
/*
|
||||
* we keep track of how many characters are stored in 'where_args' with 'where_count'.
|
||||
* Note this doesn't include the trailing null character.
|
||||
|
@ -1,11 +1,11 @@
|
||||
/* $NetBSD: file.c,v 1.47 2001/03/05 16:46:23 wiz Exp $ */
|
||||
/* $NetBSD: file.c,v 1.48 2001/09/26 13:48:28 hubertf Exp $ */
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static const char *rcsid = "from FreeBSD Id: file.c,v 1.29 1997/10/08 07:47:54 charnier Exp";
|
||||
#else
|
||||
__RCSID("$NetBSD: file.c,v 1.47 2001/03/05 16:46:23 wiz Exp $");
|
||||
__RCSID("$NetBSD: file.c,v 1.48 2001/09/26 13:48:28 hubertf Exp $");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -667,7 +667,7 @@ unpack(char *pkg, char *flist)
|
||||
} else
|
||||
strcat(args, "z");
|
||||
strcat(args, "xpf");
|
||||
if (vsystem("%s %s %s %s", TAR_CMD, args, pkg, flist ? flist : "")) {
|
||||
if (vsystem("%s %s %s %s", TAR_FULLPATHNAME, args, pkg, flist ? flist : "")) {
|
||||
warnx("%s extract of %s failed!", TAR_CMD, pkg);
|
||||
return 1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user