@@ -22,10 +22,11 @@ untar <- function(tarfile, files = NULL, list = FALSE, exdir = ".",
2222                  support_old_tars  =  Sys.getenv(" R_SUPPORT_OLD_TARS" FALSE ),
2323                  tar  =  Sys.getenv(" TAR" 
2424{
25+     allow_all  <-  isTRUE(grepl(" -P" extras ))
2526    if  (inherits(tarfile , " connection" ||  identical(tar , " internal" 
2627        if  (! missing(compressed ))
2728            warning(" argument 'compressed' is ignored for the internal method" 
28-         return (untar2(tarfile , files , list , exdir , restore_times ))
29+         return (untar2(tarfile , files , list , exdir , restore_times ,  allow_all ))
2930    }
3031
3132    if  (! (is.character(tarfile ) &&  length(tarfile ) ==  1L ))
@@ -37,7 +38,7 @@ untar <- function(tarfile, files = NULL, list = FALSE, exdir = ".",
3738    if  (! nzchar(TAR ) &&  .Platform $ OS.type  ==  " windows" && 
3839        nzchar(Sys.which(" tar.exe" TAR  <-  " tar.exe" 
3940    if  (! nzchar(TAR ) ||  TAR  ==  " internal" 
40-         return (untar2(tarfile , files , list , exdir ))
41+         return (untar2(tarfile , files , list , exdir ,  restore_times ,  allow_all ))
4142
4243    # # The ability of external tar commands to handle compressed tarfiles
4344    # # automagically varies and is poorly documented.
@@ -127,7 +128,7 @@ untar <- function(tarfile, files = NULL, list = FALSE, exdir = ".",
127128
128129# #' R's "internal" untar() -- called from untar(), *not* exported
129130untar2  <-  function (tarfile , files  =  NULL , list  =  FALSE , exdir  =  " ." 
130-                    restore_times  =  TRUE )
131+                    restore_times  =  TRUE ,  allow_all_paths   =   FALSE )
131132{
132133    # # might be used with len = 12, so result of more than max int
133134    getOctD  <-  function (block , offset , len )
0 commit comments