From bd0da7df9662ccbe2b3589ae368104a7f63b0933 Mon Sep 17 00:00:00 2001 From: des Date: Mon, 11 Jun 2001 14:18:26 +0000 Subject: [PATCH] Pass on the verbose option to fetchGetURL(). In the child that's set up to run tar(1), close all file descriptors except stdin, stdout and stderr. PR: bin/27760 --- usr.sbin/pkg_install/lib/file.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/usr.sbin/pkg_install/lib/file.c b/usr.sbin/pkg_install/lib/file.c index baf65b18f247..42602ec81ebf 100644 --- a/usr.sbin/pkg_install/lib/file.c +++ b/usr.sbin/pkg_install/lib/file.c @@ -151,6 +151,7 @@ fileGetURL(char *base, char *spec) int pfd[2], pstat; size_t r, w; char *hint; + int fd; rp = NULL; /* Special tip that sysinstall left for us */ @@ -196,7 +197,7 @@ fileGetURL(char *base, char *spec) else strcpy(fname, spec); - if ((ftp = fetchGetURL(fname, NULL)) == NULL) { + if ((ftp = fetchGetURL(fname, Verbose ? "v" : NULL)) == NULL) { printf("Error: FTP Unable to get %s: %s\n", fname, fetchLastErrString); return NULL; @@ -221,9 +222,9 @@ fileGetURL(char *base, char *spec) exit(2); } if (!tpid) { - close(pfd[1]); dup2(pfd[0], 0); - close(pfd[0]); + for (fd = 3; fd < OPEN_MAX; ++fd) + close(fd); execl("/usr/bin/tar", "tar", Verbose ? "-xzvf" : "-xzf", "-", 0); _exit(2); }