Bug 801823 - rlFileRestore breaks security context of /etc directory tree
rlFileRestore breaks security context of /etc directory tree
Status: CLOSED DUPLICATE of bug 800906
Product: Fedora
Classification: Fedora
Component: beakerlib (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Petr Muller
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2012-03-09 10:20 EST by Lukas Pramuk
Modified: 2016-09-19 22:08 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-03-12 21:31:14 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Lukas Pramuk 2012-03-09 10:20:25 EST
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):

How reproducible:

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-12 21:31:14 EDT

*** 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.