Edit: --delay-directory-restore solve the problem below that you cannot unlock the file. Pwd permissions are still changed, so the problem with the original poster may not be resolved.
Not exactly the answer, but a way to reproduce the error.
First create some files and directories. Remove write access to directories:
mkdir hello mkdir hello/world echo "bar" > hello/world/foo.txt chmod -w hello/world chmod -w hello
Then create the tar file from the directory, keeping the permissions.
cd hello tar -cpf ../hw.tar --no-recursion ./ world world/foo.txt cd ..
List of archives:
tar -tvf hw.tar
So far I have not been able to unzip the archive as a regular user due to an "Allowed Failure" -error. Unable to quickly unzip the archive. The permissions of the local directory also change.
mkdir untar cd untar ls -ld .
The experiment with umask and / or -p did not help. However, adding --delay-directory-restore helps to expand:
tar -xv --delay-directory-restore -f ../hw.tar # ./
You can also unzip the file with root privileges. What surprises me the most is that tar seems to be able to change pwd permissions, which is still not resolved.
By the way, I initially got into this problem by creating a tarball for / with
tar -cvpzf backup.tar.gz --exclude=/backup.tar.gz --one-file-system /
as root (pwd = /) and cancel it as a normal user to create a linux container.
source share