I run into an error while extracting a tar file, the created directory are created with the chmod 666 instead of 777. Therefore it will not extract inside this folder.
Here is my command:
$umask 000 && tar -xvzf compress.tgz
tar: dist/assets: Cannot mkdir: Permission denied
tar: dist/assets/favicon.ico: Cannot open: Permission denied
$ls -ll
drw-rw-rw- 2 user grp 4096 Mar 14 16:43 assets
I used this module on local to compress the file:
https://www.npmjs.com/package/tar
When I create a directory with mkdir it gives 777 mode, what am I missing?
As requested:
-bash-4.2$ tar tzvf compress.tgz
drw-rw-rw- 0/0 0 2018-03-15 12:17 dist/
-rw-rw-rw- 0/0 13117 2018-03-15 12:17 dist/3rdpartylicenses.txt
drw-rw-rw- 0/0 0 2018-03-15 12:17 dist/assets/
I use --strip 1
to extract.
tar
does have ap
flag to preserve permissions however poor they may be