summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorben <ben>2005-12-06 01:08:09 +0000
committerben <ben>2005-12-06 01:08:09 +0000
commit561bb237bc1ffd968b254112427d20df01ca1935 (patch)
treed0b8a45a08ed4de37940aca22712c82887215c95 /pkgtools
parent701859e68e67dfaa4d106a567fda6aa2ccdf69a3 (diff)
downloadpkgsrc-561bb237bc1ffd968b254112427d20df01ca1935.tar.gz
Specify the full path to tar when unpacking a package.
Modify pfcexec so the new process file name can be different from argv[0]. This fix is from Peter Postma, and it addresses PR#32228
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkg_install/files/add/futil.c12
-rw-r--r--pkgtools/pkg_install/files/lib/fexec.c8
-rw-r--r--pkgtools/pkg_install/files/lib/file.c6
-rw-r--r--pkgtools/pkg_install/files/lib/lib.h4
4 files changed, 15 insertions, 15 deletions
diff --git a/pkgtools/pkg_install/files/add/futil.c b/pkgtools/pkg_install/files/add/futil.c
index 8f6e9dbd37f..c314842b789 100644
--- a/pkgtools/pkg_install/files/add/futil.c
+++ b/pkgtools/pkg_install/files/add/futil.c
@@ -1,4 +1,4 @@
-/* $NetBSD: futil.c,v 1.8 2005/11/23 14:33:50 ben Exp $ */
+/* $NetBSD: futil.c,v 1.9 2005/12/06 01:08:09 ben Exp $ */
#if HAVE_CONFIG_H
#include "config.h"
@@ -11,7 +11,7 @@
#if 0
static const char *rcsid = "from FreeBSD Id: futil.c,v 1.7 1997/10/08 07:45:39 charnier Exp";
#else
-__RCSID("$NetBSD: futil.c,v 1.8 2005/11/23 14:33:50 ben Exp $");
+__RCSID("$NetBSD: futil.c,v 1.9 2005/12/06 01:08:09 ben Exp $");
#endif
#endif
@@ -107,7 +107,7 @@ apply_perms(char *dir, char **args, int nargs)
argv[0] = CHMOD_CMD;
argv[1] = "-R";
argv[2] = Mode;
- if (pfcexec(cd_to, argv))
+ if (pfcexec(cd_to, argv[0], argv))
warnx("couldn't change modes of '%s' ... to '%s'",
args[0], Mode);
}
@@ -122,7 +122,7 @@ apply_perms(char *dir, char **args, int nargs)
argv[0] = CHOWN_CMD;
argv[1] = "-R";
argv[2] = owner_group;
- if (pfcexec(cd_to, argv))
+ if (pfcexec(cd_to, argv[0], argv))
warnx("couldn't change owner/group of '%s' ... to '%s:%s'",
args[0], Owner, Group);
free(argv);
@@ -132,7 +132,7 @@ apply_perms(char *dir, char **args, int nargs)
argv[0] = CHOWN_CMD;
argv[1] = "-R";
argv[2] = Owner;
- if (pfcexec(cd_to, argv))
+ if (pfcexec(cd_to, argv[0], argv))
warnx("couldn't change owner of '%s' ... to '%s'",
args[0], Owner);
free(argv);
@@ -143,7 +143,7 @@ apply_perms(char *dir, char **args, int nargs)
argv[0] = CHGRP_CMD;
argv[1] = "-R";
argv[2] = Group;
- if (pfcexec(cd_to, argv))
+ if (pfcexec(cd_to, argv[0], argv))
warnx("couldn't change group of '%s' ... to '%s'",
args[0], Group);
}
diff --git a/pkgtools/pkg_install/files/lib/fexec.c b/pkgtools/pkg_install/files/lib/fexec.c
index 0d0f18990de..c5524564ec5 100644
--- a/pkgtools/pkg_install/files/lib/fexec.c
+++ b/pkgtools/pkg_install/files/lib/fexec.c
@@ -65,7 +65,7 @@
#include "lib.h"
#ifndef lint
-__RCSID("$NetBSD: fexec.c,v 1.7 2005/11/23 04:49:51 ben Exp $");
+__RCSID("$NetBSD: fexec.c,v 1.8 2005/12/06 01:08:09 ben Exp $");
#endif
static int vfcexec(const char *, int, const char *, va_list);
@@ -76,7 +76,7 @@ static int vfcexec(const char *, int, const char *, va_list);
* wait for the command to finish, then return the exit status.
*/
int
-pfcexec(const char *path, const char **argv)
+pfcexec(const char *path, const char *file, const char **argv)
{
pid_t child;
int status;
@@ -87,7 +87,7 @@ pfcexec(const char *path, const char **argv)
if ((path != NULL) && (chdir(path) < 0))
_exit(127);
- (void) execvp(argv[0], (char ** const)argv);
+ (void)execvp(file, (char ** const)argv);
_exit(127);
/* NOTREACHED */
case -1:
@@ -146,7 +146,7 @@ vfcexec(const char *path, int skipempty, const char *arg, va_list ap)
argv[argc++] = arg;
} while (arg != NULL);
- return pfcexec(path, argv);
+ return pfcexec(path, argv[0], argv);
}
int
diff --git a/pkgtools/pkg_install/files/lib/file.c b/pkgtools/pkg_install/files/lib/file.c
index 19233be269a..75d548de95a 100644
--- a/pkgtools/pkg_install/files/lib/file.c
+++ b/pkgtools/pkg_install/files/lib/file.c
@@ -1,4 +1,4 @@
-/* $NetBSD: file.c,v 1.16 2005/11/23 04:49:51 ben Exp $ */
+/* $NetBSD: file.c,v 1.17 2005/12/06 01:08:09 ben Exp $ */
#if HAVE_CONFIG_H
#include "config.h"
@@ -17,7 +17,7 @@
#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.16 2005/11/23 04:49:51 ben Exp $");
+__RCSID("$NetBSD: file.c,v 1.17 2005/12/06 01:08:09 ben Exp $");
#endif
#endif
@@ -676,7 +676,7 @@ unpack(const char *pkg, const lfile_head_t *filesp)
printf("\n");
}
- result = pfcexec(NULL, (const char **)up_argv);
+ result = pfcexec(NULL, TAR_CMD, (const char **)up_argv);
free(up_argv);
if (result != 0) {
warnx("extract of %s failed", pkg);
diff --git a/pkgtools/pkg_install/files/lib/lib.h b/pkgtools/pkg_install/files/lib/lib.h
index fa10336b94b..09acf9933b1 100644
--- a/pkgtools/pkg_install/files/lib/lib.h
+++ b/pkgtools/pkg_install/files/lib/lib.h
@@ -1,4 +1,4 @@
-/* $NetBSD: lib.h,v 1.20 2005/11/28 01:50:21 ben Exp $ */
+/* $NetBSD: lib.h,v 1.21 2005/12/06 01:08:09 ben Exp $ */
/* from FreeBSD Id: lib.h,v 1.25 1997/10/08 07:48:03 charnier Exp */
@@ -313,7 +313,7 @@ void show_version(void);
int fexec(const char *, ...);
int fexec_skipempty(const char *, ...);
int fcexec(const char *, const char *, ...);
-int pfcexec(const char *path, const char **argv);
+int pfcexec(const char *, const char *, const char **);
pipe_to_system_t *pipe_to_system_begin(const char *, char *const *, void (*)(void));
int pipe_to_system_end(pipe_to_system_t *);