Skip to content

Commit 8cce848

Browse files
author
ripley
committed
updates, mention -P
git-svn-id: https://svn.r-project.org/R/trunk@88328 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent 4efce94 commit 8cce848

File tree

2 files changed

+25
-12
lines changed

2 files changed

+25
-12
lines changed

src/library/utils/man/tar.Rd

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,12 @@ tar(tarfile, files = NULL,
188188
\I{Heirloom Toolchest} are not documented to support \command{xz} nor
189189
\command{zstd}.
190190

191-
The \command{tar} program in recent macOS (e.g.\sspace{}15.2) does
192-
support \command{zstd} compression.\emph{via} an
193-
external command, but Apple does not supply one.
191+
The \command{tar} program in recent macOS (e.g.\sspace{}15.5) does
192+
support \command{zstd} compression.\emph{via} an external
193+
\command{zstd} program, but Apple does not supply one.
194194

195-
The \command{tar} programs in commercial Unixen such as \I{AIX} and
196-
Solaris do not support compression.
195+
%% The \command{tar} programs in commercial Unixen such as \I{AIX} and
196+
%% Solaris do not support compression.
197197

198198
GNU \command{tar} added support in version 1.22 for \command{xz}
199199
compression and in version 1.31 for \command{zstd} compression.
@@ -204,15 +204,21 @@ tar(tarfile, files = NULL,
204204
support parallel compression --- but this function can be used to write
205205
an uncompressed tarball which can then be compressed in parallel, for
206206
example with \command{zstd -T0}.
207+
208+
Some external commands have \sQuote{security} measures to by default
209+
change the recorded file paths. For example, GNU \code{tar} and
210+
\command{bsdtar} remove the leading slash on absolute filepaths:
211+
specify \code{extra_flags = "-P"} to override this.
207212
}
208213

209214
\note{
210-
For users of macOS. Apple's file systems have a legacy concept of
215+
For users of macOS. Apple's legacy file systems had a concept of
211216
\sQuote{resource forks} dating from classic Mac OS and rarely used
212-
nowadays. Apple's version of \command{tar} stores these as separate
213-
files in the tarball with names prefixed by \file{._}, and unpacks
214-
such files into resource forks (if possible): other ways of unpacking
215-
(including \code{\link{untar}} in \R) unpack them as separate files.
217+
nowadays (and only partially supported in APFS). Apple's version of
218+
\command{tar} stored these as separate files in the tarball with names
219+
prefixed by \file{._}, and unpacks such files into resource forks (if
220+
possible): other ways of unpacking (including \code{\link{untar}} in
221+
\R) unpack them as separate files.
216222

217223
When argument \code{tar} is set to the command \command{tar} on macOS,
218224
environment variable \env{COPYFILE_DISABLE=1} is set, which for the

src/library/utils/man/untar.Rd

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ untar(tarfile, files = NULL, list = FALSE, exdir = ".",
5252
}
5353

5454
\item{extras}{\code{NULL} or a character string: further command-line
55-
flags such as \option{-p} to be passed to an external \command{tar}
56-
program.}
55+
flags such as \option{-p} or \option{-P} to be passed to an external
56+
\command{tar} program.}
5757

5858
\item{verbose}{logical: if true echo the command used for an external
5959
\command{tar} program.}
@@ -200,6 +200,13 @@ untar(tarfile, files = NULL, list = FALSE, exdir = ".",
200200
The internal implementation does not special-case \sQuote{resource
201201
forks} in macOS: that system's \command{tar} command does. This may
202202
lead to unexpected files with names with prefix \file{._}.
203+
204+
Some external commands have \sQuote{security} measures to change the
205+
extracted file paths. For example, GNU \code{tar} and
206+
\command{bsdtar} remove the leading slash on absolute filepaths:
207+
specify \code{extras = "-P"} to override this. \command{bsdtar}
208+
refuses to exract paths containing \code{".."} with the same
209+
workaround.
203210
}
204211
205212
\value{

0 commit comments

Comments
 (0)