Bug 208835 - EA set failure when restoring immutable file
Summary: EA set failure when restoring immutable file
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: dump
Version: 5
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Adam Tkac
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-10-02 10:44 UTC by Andrew Kroeger
Modified: 2017-10-12 14:09 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-01-29 12:25:03 UTC
Type: ---
Embargoed:


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

Description Andrew Kroeger 2006-10-02 10:44:41 UTC
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 13:03:13 UTC
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-27 01:08:00 UTC
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-27 01:18:21 UTC
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 12:25:03 UTC
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.