bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-tar] Cannot: extract a member reliably with possible leading dot-sl


From: Viktor Sergiienko
Subject: [Bug-tar] Cannot: extract a member reliably with possible leading dot-slash
Date: Tue, 11 Dec 2018 13:29:38 -0800

Hello,

I've had this problem multiple times, and now I have a confirmation
other people had it too:
https://serverfault.com/questions/803831/tar-extract-a-member-reliably-with-possible-leading-dot-slash

I'll quote andrewsh's problem description:

> $ tar tvf archive1.tar
> -rw-r--r-- root/root 567 2016-09-18 14:28 member1
> -rw-r--r-- root/root 1696 2016-09-18 14:28 member2
> $ tar tvf archive2.tar
> -rw-r--r-- root/root 567 2016-09-18 14:28 ./member1
> -rw-r--r-- root/root 1696 2016-09-18 14:28 ./member2
>
> How to extract member1 reliably from either of two archives? I’m receiving 
> the tar over a pipe, the generator isn’t under my control, and while I can 
> run the pipeline multiple times, I’d really like to avoid doing so without 
> necessity.
>
> $ tar xOvf archive1.tar member1 > /dev/null
> member1
> $ tar xOvf archive2.tar member1 > /dev/null
> tar: member1: Not found in archive
> tar: Exiting with failure status due to previous errors

BSD tar handles it both ways.
I feel that GNU tar needs to either support forms with and without ./
prefix, or have a switch to enable such.

Thank you.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]