From c74f8d82e5db0af5a75c342e6296193b74dfb1c8 Mon Sep 17 00:00:00 2001 From: dsl Date: Thu, 11 Nov 2004 22:39:03 +0000 Subject: [PATCH] Specify --chroot and -h to tar so that it will chroot into the target filesystem and then follow existing symbolic links in that filesystem. The choot is required to make absolute links be processed correctly, and must be done by tar because the program (and input file) do not exist inside the chroot. Fixes PR install/5010 and install/8090 (at least) --- distrib/utils/sysinst/util.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/distrib/utils/sysinst/util.c b/distrib/utils/sysinst/util.c index 2cb32693e443..de65d9fde255 100644 --- a/distrib/utils/sysinst/util.c +++ b/distrib/utils/sysinst/util.c @@ -1,4 +1,4 @@ -/* $NetBSD: util.c,v 1.131 2004/11/11 22:30:49 dsl Exp $ */ +/* $NetBSD: util.c,v 1.132 2004/11/11 22:39:03 dsl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -653,16 +653,16 @@ extract_file(int set, int update, int verbose, char *path) } else target_chdir_or_die("/"); - /* now extract set files files into "./". */ + /* now extract set files into "./". */ if (verbose == 0) tarexit = run_program(RUN_DISPLAY | RUN_PROGRESS, - "progress -zf %s tar -xepf -", path); + "progress -zf %s tar --chroot -xhepf -", path); else if (verbose == 1) tarexit = run_program(RUN_DISPLAY, - "tar -zxepf %s", path); + "tar --chroot -zxhepf %s", path); else tarexit = run_program(RUN_DISPLAY | RUN_PROGRESS, - "tar -zxvepf %s", path); + "tar --chroot -zxhvepf %s", path); chdir(owd); free(owd);