You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Tar entries should be able to handle paths that begin with "./", including the root path itself #70516
System.IO.IOException : Extracting the Tar entry './' would have resulted in a file outside the specified destination directory: 'C:\Users\carlos\AppData\Local\Temp\zm5gtquh.qu5\'
changed the title [-]Tar entries should be able to handle paths that begin with "\.", including the root path itself[/-][+]Tar entries should be able to handle paths that begin with "./", including the root path itself[/+]on Jun 10, 2022
The prefix ./ gets added to files when the tar command is executed with explicit addition of the ./ prefix on the individual entries to be archived:
tar -cvf target.tar ./file.txt ./directory/
This usually happens when the file is added by tabbing for autocomplete.
The prefix is not added if you use * to include all files in a location:
tar -cvf target.tar *
So to add the ./ entry to the archive (the cause of this bug), you'd have to execute the command using:
tar -cvf target.tar ./
Which would add all the files in the current directory (excluding the tar archive you're creating), will prepend the ./ prefix to all the entries, and will also include the single entry ./ at the beginning of the archive.
When you open such archive with 7-zip, it shows at the root a single directory entry named . and all the rest of the entries are under that directory.
ghost added
in-prThere is an active PR which will close this issue when it is merged
Activity
[-]Tar entries should be able to handle paths that begin with "\.", including the root path itself[/-][+]Tar entries should be able to handle paths that begin with "./", including the root path itself[/+]carlossanlop commentedon Jun 10, 2022
The prefix
./gets added to files when the tar command is executed with explicit addition of the./prefix on the individual entries to be archived:This usually happens when the file is added by tabbing for autocomplete.
The prefix is not added if you use
*to include all files in a location:So to add the
./entry to the archive (the cause of this bug), you'd have to execute the command using:Which would add all the files in the current directory (excluding the tar archive you're creating), will prepend the
./prefix to all the entries, and will also include the single entry./at the beginning of the archive.When you open such archive with 7-zip, it shows at the root a single directory entry named
.and all the rest of the entries are under that directory.