Bug 963677 - permission are different after untar
permission are different after untar
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: tar (Show other bugs)
7.0
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Pavel Raiskup
qe-baseos-daemons
: Regression
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-16 07:25 EDT by Petr Sklenar
Modified: 2013-06-07 03:00 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-06-07 03:00:31 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Petr Sklenar 2013-05-16 07:25:19 EDT
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 08:25:51 EDT
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 08:42:40 EDT
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 08:54:14 EDT
> 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 09:01:28 EDT
(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 03:00:31 EDT
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

Note You need to log in before you can comment on or make changes to this bug.