bug-tar
[Top][All Lists]
Advanced

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

Possible bug


From: Karlis Abele | Printful
Subject: Possible bug
Date: Tue, 27 Apr 2021 09:39:56 +0300

Hey! So I recently ran into an issue regarding directory ownership changes when extracting certain tar files.

How to reproduce:
You can test this out locally like so with docker
Start a new alpine container docker run -it --rm alpine ash
Create some random folder structure to archive mkdir -p ~/test/folder
Change to test dir cd ~/test
Change ownership to something random chown -R 1234:1234 .
Create an archive like so tar -zcf test.tar.gz .
And extract it somewhere tar -zxf test.tar.gz -C /var
Now the /var ownership is 1234:1234

The implications:
This means that if for example I extract the archive that is created in a similar manner to for example /root, it will mess up the root directory ownership (possibly) and can pretty much brick the instance

I understand that there are flags regarding ownership and permissions when extracting archives, but I do think that using the . should not make it so that after extracting the archive it changes ownership of the target directory

Printful Logo
Karlis Abele,
System Administrator & DevOps Engineer
Phone:28 466 009
Email:karlis.abele@printful.com
Website:www.printful.com

Facebook Twitter Instagram Youtube

reply via email to

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