diff options
author | des <des@FreeBSD.org> | 2001-06-11 14:18:26 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2001-06-11 14:18:26 +0000 |
commit | bd0da7df9662ccbe2b3589ae368104a7f63b0933 (patch) | |
tree | 5f73402b46af10b9489dc0ab42987526808ca2d7 /usr.sbin/pkg_install | |
parent | f47c06a197bb872f095a5326bb93d6c33363352a (diff) | |
download | FreeBSD-src-bd0da7df9662ccbe2b3589ae368104a7f63b0933.zip FreeBSD-src-bd0da7df9662ccbe2b3589ae368104a7f63b0933.tar.gz |
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
Diffstat (limited to 'usr.sbin/pkg_install')
-rw-r--r-- | usr.sbin/pkg_install/lib/file.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/pkg_install/lib/file.c b/usr.sbin/pkg_install/lib/file.c index baf65b1..42602ec 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); } |