Bug 801823 - rlFileRestore breaks security context of /etc directory tree
Summary: rlFileRestore breaks security context of /etc directory tree
Keywords:
Status: CLOSED DUPLICATE of bug 800906
Alias: None
Product: Fedora
Classification: Fedora
Component: beakerlib
Version: 16
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Petr Muller
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-03-09 15:20 UTC by Lukas Pramuk
Modified: 2016-09-20 02:08 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-03-13 01:31:14 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Lukas Pramuk 2012-03-09 15:20:25 UTC
Description of problem:
Using rlFileBackUp/rlFileRestore functions doesn't preserve original security context of the directory tree. By using function rlFileRestore you break original context of the directory trees for all backuped files.
(restoring of file "/etc/sysconfig/network" breaks contexts of /etc and etc/sysconfig directory) 

Version-Release number of selected component (if applicable):
beakerlib-1.4-1.fc16.noarch

How reproducible:
always

Steps to Reproduce:
1. . /usr/lib/beakerlib/beakerlib.sh && rlJournalStart
2. rlFileBackup /etc/sysconfig/network
3. rlFileRestore 
4. restorecon -rv /etc
restorecon reset /etc context unconfined_u:object_r:user_tmp_t:s0->unconfined_u:object_r:etc_t:s0
restorecon reset /etc/sysconfig context unconfined_u:object_r:user_tmp_t:s0->unconfined_u:object_r:etc_t:s0

  
Actual results:
ls -dZ /etc /etc/sysconfig (after rlFileRestore)
drwxr-xr-x. root root unconfined_u:object_r:user_tmp_t:s0 /etc
drwxr-xr-x. root root unconfined_u:object_r:user_tmp_t:s0 /etc/sysconfig

Expected results:
ls -dZ /etc /etc/sysconfig
drwxr-xr-x. root root unconfined_u:object_r:etc_t:s0   /etc
drwxr-xr-x. root root unconfined_u:object_r:etc_t:s0   /etc/sysconfig

Additional info:

Comment 1 Petr Muller 2012-03-13 01:31:14 UTC

*** This bug has been marked as a duplicate of bug 800906 ***


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