Problem with tar on RHEL5.8

Hi All,

I have a tar file that I want to extract, I need the permissions and owners of the file to be the same as on when they were tared.

I am using this command to un-tar the file.

tar --acl --xattrs --same-owner --same-permissions -zvxf MANJUNATH_acl_corner_cases.tgz -C /cifs1/share1/

sometimes, the files gets un-tar properly and max of the time I 'm hit with these errors...

[AIROOT@ib35-12s9 crossProtocolACLTests]$ tar --acl --xattrs --same-owner --same-permissions -p -zvxf MANJUNATH_acl_corner_cases.tgz
full/
full/TC75_file_1.py
tar: full/TC75_file_1.py: Warning: Cannot acl_from_text
full/TC76_file_1.py
tar: full/TC76_file_1.py: Warning: Cannot acl_from_text
full/.fixed
full/L1/
full/L1/L2/
full/L1/L2/L3/
full/L1/L2/L3/L4/
full/L1/L2/L3/L4/L5/
full/L1/L2/L3/L4/L5/test_file_1.py
tar: full/L1/L2/L3/L4/L5/test_file_1.py: Warning: Cannot acl_from_text
full/L1/L2/L3/L4/L5/test_folder_1/
tar: full/L1/L2/L3/L4/L5/test_folder_1: Warning: Cannot acl_from_text
tar: full/L1/L2/L3/L4/L5/test_folder_1: Warning: Cannot acl_from_text
tar: full/L1/L2/L3/L4/L5: Warning: Cannot acl_from_text
tar: full/L1/L2/L3/L4/L5: Warning: Cannot acl_from_text
tar: full/L1/L2/L3/L4: Warning: Cannot acl_from_text
tar: full/L1/L2/L3/L4: Warning: Cannot acl_from_text
tar: full/L1/L2/L3: Warning: Cannot acl_from_text
tar: full/L1: Warning: Cannot acl_from_text

[AIROOT@ib35-12s9 crossProtocolACLTests]$ tar --version
tar (GNU tar) 1.15.1

Please help me find a way to overcome this. Please find the attached tar file. waiting for a quick response :confused:

As far as I can see, in my RHEL box

gacanepa@redhat /home/gacanepa:cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.7 (Tikanga)
gacanepa@redhat /home/gacanepa:tar --version
tar (GNU tar) 1.15.1

the --acl option doesn't exist. It is --acls. Also, please note from the manpage of tar that --xattrs automatically sets the --acls option:

       --acls this option causes tar to store each file's ACLs in the archive.

       --selinux
              this option causes tar to store  each  file's  SELinux  security  context  information  in  the
              archive.

       --xattrs
              this  option  causes  tar  to store each file's extended attributes in the archive. This option
              also enables --acls and--selinux if they haven't been set already, due to  the  fact  that  the
              data for those are stored in special xattrs.

Hope it helps.

Thanks for the reply..I really appreciate it.
I tried to the command with and without --acls option, and neither of it helped.
I am still getting the same error. I am more confused as the its just the warning: cannot acl from text and doesn't return and further info.

I have checked for the permissions on the file when it was successfully untar'd and there are differences in the permission and accesscontrol list for the users on the files.

Please suggest something.

I belive you will need to patch...
Red Hat Customer Portal

What is the output of

rpm -qa tar

If it's lower version then specified in the bug, then patching is required.

Regards
Peasant.

1 Like

Thanks Peasant for the reply...Here is the output :

[root@ib35-19s9 0011_run_swarm]# rpm -qa tar
tar-1.15.1-31.el5

That is actually a newer version than the suggested patch itself (which is tar-1.15.1-30.el5).
Just a shot in the dark here... what is the output of

tar -tvzf MANJUNATH_acl_corner_cases.tgz

?

Sorry, for a delayed response. Please find the output mentioned below..
[root@ib35-12s9 share1]# tar -tvzf MANJUNATH_acl_corner_cases.tgz
drwxr-x--- LOCAL\cifsusr/LOCAL\cifsgrp 0 2012-03-09 21:07:34 full/
-rwxrwx--- LOCAL\cifsusr/LOCAL\cifsgrp 177 2012-02-09 22:51:01 full/TC75_file_1.py
-rwxrwx--- LOCAL\cifsusr/LOCAL\cifsgrp 177 2012-02-09 22:51:04 full/TC76_file_1.py
-rw-rw---- root/root 0 2012-03-09 20:52:53 full/.fixed
drwxrwx--- LOCAL\cifsusr/LOCAL\cifsgrp 0 2012-03-09 21:07:26 full/L1/
drwxrwx--- LOCAL\cifsusr/LOCAL\cifsgrp 0 2012-03-09 21:07:25 full/L1/L2/
drwxrwx--- LOCAL\cifsusr/LOCAL\cifsgrp 0 2012-03-09 21:07:24 full/L1/L2/L3/
drwxrwx--- LOCAL\cifsusr/LOCAL\cifsgrp 0 2012-03-09 21:07:25 full/L1/L2/L3/L4/
drwxrwx--- LOCAL\cifsusr/LOCAL\cifsgrp 0 2012-03-09 21:07:25 full/L1/L2/L3/L4/L5/
-rwxrwx--- LOCAL\cifsusr/LOCAL\cifsgrp 177 2012-02-09 22:51:43 full/L1/L2/L3/L4/L5/test_file_1.py
drwxrwx--- LOCAL\cifsusr/LOCAL\cifsgrp 0 2012-02-09 22:51:33 full/L1/L2/L3/L4/L5/test_folder_1/

Alright. From that I can see the following facts:
1) The owner of all those files / directories is the user LOCAL\cifsusr (as shown in the 2nd column), and they are assigned to the group with the same name (LOCAL\cifsusr, as shown in the 2nd column separated from the owner by a forward slash "/"). That is to say:
LOCAL\cifsusr/LOCAL\cifsgrp --> owner / group.
2)The permissions of those files / directories are set to 770 (rwx for owner, rwx for group, none for others).
In your first post, it looks like you're trying to untar the tarball as user AIROOT (which is different from root). So, if user AIROOT is not added in the LOCAL\cifsusr group, he may not be able to untar the tarball because "others" do not have any permissions on the files included in it.

My suggestion would be to 1) try to untar the tar.gz file as root, 2) as root, perform a recursive chmod 755 on all the files / directories. Then try to untar as the AIROOT user.
Hope it helps. Let me know if I can be of further help.