Bug 1013345 - RHEL7: xfsrestore does not preserve file capabilities
RHEL7: xfsrestore does not preserve file capabilities
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: xfsdump (Show other bugs)
All Linux
medium Severity medium
: rc
: ---
Assigned To: Eric Sandeen
Eryu Guan
: 905586 1054570 (view as bug list)
Depends On: 905584 905585
Blocks: 807834 1050219
  Show dependency treegraph
Reported: 2013-09-29 08:57 EDT by Eryu Guan
Modified: 2014-06-18 00:50 EDT (History)
5 users (show)

See Also:
Fixed In Version: xfsdump-3.1.3-5.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 905585
Last Closed: 2014-06-13 06:35:37 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Comment 1 Eryu Guan 2014-01-18 09:16:41 EST
*** Bug 1054570 has been marked as a duplicate of this bug. ***
Comment 3 Fujitsu kernel engineers 2014-02-17 05:38:28 EST

We believe below upstream patch fixes this problem.
Which RHEL7 snapshot will include the patch?

commit a88c49071dde2539cce6d502effc27501416983a
Author: Dave Chinner <dchinner@redhat.com>
Date:   Thu Feb 6 16:48:39 2014 +1100

    restore: don't trash file capabilities
    xfsrestore fails to restore file capabilities correctly because it
    sets the owner on the file after it has restored the capability
    attributes. This results in the kernel stripping the capabilities
    when changing the owner of the file and hence the restored file is
    not complete.
    Fix this by changing the owner of the file when it is created rather
    than after it has been fully restored. This ensures we don't kill
    the caps as they are restored after the owner it appropriately set.
    This fixes the xfs/296 failure.

Masayoshi Mizuma
Comment 4 Eric Sandeen 2014-02-17 12:58:16 EST
*** Bug 905586 has been marked as a duplicate of this bug. ***
Comment 5 Eric Sandeen 2014-02-17 12:59:04 EST
Yes, that fixes it.  The next build of xfsdump will have this fix, I will fill in the fixed-in field when it's done.  I do not know which snapshot will include it.
Comment 6 Eric Sandeen 2014-02-17 13:00:37 EST
I can fix it after I gain blocker approval for this bug.
Comment 7 Eric Sandeen 2014-02-17 15:41:15 EST
Built in xfsdump-3.1.3-5.el7
Comment 9 Eryu Guan 2014-02-23 02:14:13 EST
Verified with xfsdump-3.1.3-5.el7, though xfs/296 still fails, but I believe it's a test case issue, and has been fixed upstream in xfstests.

=== full diff out/out.bad ===   
--- /dev/fd/63  2014-02-23 02:06:31.460922512 -0500
+++ results/xfs/296.out.bad     2014-02-23 02:06:30.913942889 -0500
@@ -50,6 +50,7 @@

 Checking for capability on restored file
-RESTORE_DIR/DUMP_SUBDIR/testfile cap_setgid,cap_setuid+ep
+RESTORE_DIR/DUMP_SUBDIR/testfile = cap_setgid,cap_setuid+ep
 # file: RESTORE_DIR/DUMP_SUBDIR/testfile

Fixed by

Date: Wed,  5 Feb 2014 12:53:12 +1100
From: Dave Chinner <david@fromorbit.com>
To: xfs@oss.sgi.com
Subject: [PATCH] xfs/296: fix golden output

From: Dave Chinner <dchinner@redhat.com>

This test never passed, so the golden output was never properly
verified as correct. Now that the bug is fixed, fix the golden
output to match the actual test output.

Signed-off-by: Dave Chinner <dchinner@redhat.com>

Comment 10 Ludek Smid 2014-06-13 06:35:37 EDT
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.

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