Project

General

Profile

Actions

Bug #3383

closed

tar xzvf in a local zone fails to preserve file permissions

Added by M Neus about 9 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
2012-11-24
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

Note: All commands executed as root in a local zone on OI_151a7:

e.g. download serviio 1.0.1 from http://download.serviio.org/releases/serviio-1.0.1-linux.tar.gz and copy it to the local zone.

  1. tar xzvf serviio-1.0.1-linux.tar.gz

results in the following warnings displayed on the console:

tar: warning - file permissions have changed for serviio-1.0.1/xxx/yyy (are 0106777, should be 0107777) for several files.

Untaring the same file in the global zone does not present any warnings.


Files

zone.txt (10.9 KB) zone.txt Tar Warings: Console output of "tar xzvf serviio-1.0.1-linux.tar.gz" M Neus, 2012-11-25 06:22 PM
Content.txt (5.11 KB) Content.txt Tar Content: Console output of "tar tzvf serviio-1.0.1-linux.tar.gz" M Neus, 2012-11-25 06:22 PM
Actions #1

Updated by Igor Pashev about 9 years ago

Did you try to do chmod, chown? truss, etc.

Actions #2

Updated by M Neus about 9 years ago

I assume you mean on the tar file itself? No. The tar file already shows root owner & group with all (rwx) root permissions. Tar is extracted as root in either case.

If you mean after extracted:

When extracted in the local zone, I chown -R the extracted directory to a non-privileged local zone user & group. When executed within the local zone it does run but certain functions are unstable/inoperable.

When extracted from the global zone, I copy the directory to it's final local in the local zone, then chown -R the directory to a non-privileged local zone user & group. When executed everything works as expected (in this case).

Thanks.

Actions #3

Updated by Igor Pashev about 9 years ago

It whould be much more constructive if you show

1. full output from tar
2. full contents of the tarball (with mode and owner)
3. what "chmod 7777 xxxx/yyyy" says

Actions #4

Updated by M Neus about 9 years ago

As requested.

Q1: full output from tar. A1: see attached 'zone.txt'. NOTE: I'm not sure if this means anything but I couldn't capture the tar messages using a redirect (i.e. tar xzvf serviio-1.0.1-linux.tar.gz > zone.txt) as the tar warnings still displayed to the console.

Q2: Full contents of the tarball (with mode and owner). A2: See attached content.txt

Q3: what "chmod 7777 xxxx/yyyy" says. A3: chmod -R 7777 serviio-1.0.1 reports no errors/warnings and appears to produce the expected results (all files have permissions -rwsrwsrwx+, directories drwsrwsrwt+)

chmod -R 777 serviio-1.0.1 produced no errors/warnings and appears to have the desired result (all files given full permissions throughout the directory tree)

Thanks

Actions #5

Updated by M Neus about 9 years ago

Sorry, ignore the final sentence above, it is a leftover from creating the message (and a typo at that).

Actions #6

Updated by Ken Mays almost 9 years ago

  • Status changed from New to Closed
  • Assignee set to Ken Mays
  • % Done changed from 0 to 100

Depends on how you create or extract the tarball:
You can do tar -p{x|c}vzf xxx.tar.gz
The 'p' option is what you need for preservation.

Actions

Also available in: Atom PDF