Bug 208835 - EA set failure when restoring immutable file
EA set failure when restoring immutable file
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: dump (Show other bugs)
5
All Linux
medium Severity medium
: ---
: ---
Assigned To: Adam Tkac
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-10-02 06:44 EDT by Andrew Kroeger
Modified: 2013-04-30 19:34 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-01-29 07:25:03 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
test package (250.87 KB, application/octet-stream)
2006-11-28 08:03 EST, Adam Tkac
no flags Details
Patch that solves the problem initially reported (2.18 KB, patch)
2007-01-26 20:18 EST, Andrew Kroeger
no flags Details | Diff

  None (edit)
Description Andrew Kroeger 2006-10-02 06:44:41 EDT
Description of problem:
When restoring a file that has the immutable flag set, restore displays a
warning ("restore: ./root/.bash_history: EA set
security.selinux:root:object_r:user_home_t:s0 failed: Operation not permitted")
and the SELinux file context is not restored.

Version-Release number of selected component (if applicable):
dump-0.4b41-2

How reproducible:
Always.

Steps to Reproduce:
1. Create a dump containing a file with the immutable flag set
2. Restore the dump
  
Actual results:
Warning displayed and SELinux context not restored.

Expected results:
File successfully restored with appropriate SELinux context.
Comment 1 Adam Tkac 2006-11-28 08:03:13 EST
Created attachment 142282 [details]
test package

Please, could you test this package? problem could be fixed here. Thanks much
Comment 2 Andrew Kroeger 2007-01-26 20:08:00 EST
The SELinux patches in the updated package did not correct the problem.  After
further investigation, I found that the restore code was restoring the flags
before trying to set the SELinux context.  After the immutable flag set, no file
modifications (EA attributes, update timestamps, etc.) can be made.

I will attach the patch that I came up with that solved my specific problem.
Comment 3 Andrew Kroeger 2007-01-26 20:18:21 EST
Created attachment 146737 [details]
Patch that solves the problem initially reported

The basic idea of this patch is to make all necessary changes (EA attributes,
timestamps, etc.) before restoring the flags.

I cannot provide any guarantees with this patch, as I did not test anything
beyond the specific error I reported.  Although things looked good when I made
a quick review, there may be side-effects or corner cases involving the
relocation of the timestamp updates that I did not see.
Comment 4 Adam Tkac 2007-01-29 07:25:03 EST
Yes, your patch looks fine. I've added it to rawhide. Thanks for it

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