Bug 963677

Summary: permission are different after untar
Product: Red Hat Enterprise Linux 7 Reporter: Petr Sklenar <psklenar>
Component: tarAssignee: Pavel Raiskup <praiskup>
Status: CLOSED NOTABUG QA Contact: qe-baseos-daemons
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0CC: ovasik
Target Milestone: rcKeywords: Regression
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-06-07 07:00:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Petr Sklenar 2013-05-16 11:25:19 UTC
Description of problem:
permission are different after untar

Version-Release number of selected component (if applicable):
tar-1.26-21.el7.ppc64

How reproducible:
always

Steps to Reproduce:
 
tempString () {
    TEMPSTR=`date +%N | md5sum | awk '{print $1}'`
    TEMPSTR=${TEMPSTR:0:8}
    echo $TEMPSTR
}

TSTUSER="user`tempString`"

rlJournalStart
    rlPhaseStartSetup
        rlAssertRpm $PACKAGE
        rlRun "TmpDir=\`mktemp -d\`" 0 "Creating tmp directory"
        rlRun "pushd $TmpDir"

        rlRun "chmod 0777 $TmpDir"
        
        rlRun "adduser $TSTUSER"
        
        rlRun "mkdir pizza"
        rlRun "chmod 0700 pizza"
        rlRun "setfacl -m u:$TSTUSER:rwx pizza"
        
        rlRun "echo ciao > pizza/hello"

    rlPhaseEnd

    rlPhaseStartTest
        rlRun "tar --acls -cf package_with_acl.tar pizza"
        rlRun "tar -cf package_without_acl.tar pizza"
        
        rlRun "rm -rf pizza"
        rlRun "tar -xf package_without_acl.tar"

        rlRun "su $TSTUSER -c 'cat $TmpDir/pizza/hello'" 1 

        rlRun "rm -rf pizza"

        rlRun "tar -xf package_with_acl.tar"
        
        rlRun "su $TSTUSER -c 'cat $TmpDir/pizza/hello'" 0 
#### ^^^ this fails with new version
    rlPhaseEnd

Actual results:
permission are different after untar
cat: /tmp/tmp.a0zhAqcXlI/pizza/hello: Permission denied

Expected results:
user can see the files

Additional info:
tar-1.26-12.el7.x86_64 : works
tar-1.26-21.el7.ppc64 : this bug

Comment 4 Pavel Raiskup 2013-05-16 12:25:51 UTC
Thanks for the report.  This RHEL 7 version of tar tries to be as close as
possible to upstream tar.  The original commit adding --xattrs upstream is
here http://git.savannah.gnu.org/cgit/tar.git/commit/?id=696338043e52f44 .

The reason why this bug test fails is that the --selinux, --acls, and --xattrs
options are not enabled in upstream tar by default during extraction.

Pavel

Comment 6 Ondrej Vasik 2013-05-16 12:42:40 UTC
It is change in behaviour which might be expected between major releases. I agree with keeping tar as close as possible to upstream version settings. We already differ in some details and it proved to be wrong way. However - what I find strange is that Petr claims it works on x86_64 and doesn't work on ppc64.

Comment 7 Pavel Raiskup 2013-05-16 12:54:14 UTC
> However - what I find strange is that Petr claims it works on x86_64 and
> doesn't work on ppc64.

This confused me also..  But it seems that it is just because on x86_64 was
tested older package than on ppc64:

(In reply to comment #0)
> 
> Additional info:
> tar-1.26-12.el7.x86_64 : works
> tar-1.26-21.el7.ppc64 : this bug

Petr, is that correct?

Pavel

Comment 8 Petr Sklenar 2013-05-16 13:01:28 UTC
(In reply to comment #7)
> > However - what I find strange is that Petr claims it works on x86_64 and
> > doesn't work on ppc64.
> 
> This confused me also..  But it seems that it is just because on x86_64 was
> tested older package than on ppc64:
> 
> (In reply to comment #0)
> > 
> > Additional info:
> > tar-1.26-12.el7.x86_64 : works
> > tar-1.26-21.el7.ppc64 : this bug
> 
> Petr, is that correct?
> 
> Pavel

Yes, there are no different between arch. X86_64 was old, ppc64 is new.
We will rewrite test as its expected change.

Comment 9 Pavel Raiskup 2013-06-07 07:00:31 UTC
With Petr's ACK: as this is upstream behavior, and unlikely to be changed, it
is not a bug in RHEL7 tar and our tests will be changed.  Thanks for looking
at it!  Pavel