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
What version of the package or command are you using?
v3.5.1
What are you trying to do?
Trying to extract a tar.gz file (which I suspect might replicate with other archive formats) that contains a read-only folder along with its files.
What steps did you take?
Create an archive with a write-protected folder:
mkdir -p TestArchive/writeprotectedfolder
touch TestArchive/writeprotectedfolder/file1.txt
touch TestArchive/writeprotectedfolder/file2.txt
chmod -w TestArchive/writeprotectedfolder/
tar -xzf example.tar.gz
Untar using the Unarchive function
What did you expect to happen, and what actually happened instead?
An error returned: reading file in tar archive: /path/TestArchive/writeprotectedfolder/file2.txt: creating new file: open /path/TestArchive/writeprotectedfolder/file2.txt: permission denied
How do you think this should be fixed?
The issue arises when the code creates the writeprotectedfolder with its original read-only permissions (https://github.com/mholt/archiver/blob/v3.5.1/tar.go#L264). Consequently, we encounter an inability to write file1.txt and file2.txt into it. I intended to initiate a pull request to address this, but I am unable to do so as the master branch points to v4, and there isn't a v3 branch available.
Please link to any related issues, pull requests, and/or discussion
I believe that this pull request has caused the issue: #133.
The text was updated successfully, but these errors were encountered:
omerzi
changed the title
Unarchive protected folders fails
Unarchiving read-only folders fails
Dec 18, 2023
What version of the package or command are you using?
v3.5.1
What are you trying to do?
Trying to extract a tar.gz file (which I suspect might replicate with other archive formats) that contains a read-only folder along with its files.
What steps did you take?
Create an archive with a write-protected folder:
What did you expect to happen, and what actually happened instead?
An error returned:
reading file in tar archive: /path/TestArchive/writeprotectedfolder/file2.txt: creating new file: open /path/TestArchive/writeprotectedfolder/file2.txt: permission denied
How do you think this should be fixed?
The issue arises when the code creates the
writeprotectedfolder
with its original read-only permissions (https://github.com/mholt/archiver/blob/v3.5.1/tar.go#L264). Consequently, we encounter an inability to writefile1.txt
andfile2.txt
into it. I intended to initiate a pull request to address this, but I am unable to do so as the master branch points to v4, and there isn't a v3 branch available.Please link to any related issues, pull requests, and/or discussion
I believe that this pull request has caused the issue: #133.
The text was updated successfully, but these errors were encountered: