Bug 618269 - Backing up non-existent files results in changed security context
Summary: Backing up non-existent files results in changed security context
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: beakerlib   
(Show other bugs)
Version: 14
Hardware: All
OS: Linux
urgent
urgent
Target Milestone: ---
Assignee: Petr Šplíchal
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Keywords: Patch
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-07-26 14:34 UTC by Petr Šplíchal
Modified: 2016-06-01 01:40 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-10-07 15:41:31 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
patch for the selinux context issue + local variables (4.10 KB, patch)
2010-07-27 09:46 UTC, Petr Šplíchal
no flags Details | Diff

Description Petr Šplíchal 2010-07-26 14:34:07 UTC
Description of problem:

When a missing file is rlFileBackup-ed the security context of the
backup path is not correctly saved which results in rlFileRestore
to change the original context to that of the /tmp/ directory.

This is causing many false fails, marking as urgent. Will provide
a patch shortly. Please, deploy as soon as possible.

Version-Release number of selected component (if applicable):
beakerlib-1.3-3.el6.noarch

Steps to Reproduce:
    mkdir /tmp/dir
    chcon --reference /home /tmp/dir
    ls -ldZ /tmp/dir
    rlFileBackup "/tmp/dir/missing"
    rlFileRestore
    ls -ldZ /tmp/dir

Actual results:
drwxr-xr-x. root root system_u:object_r:home_root_t:s0 /tmp/dir
:: [10:28:21] :: [ ERROR   ] :: rlFileBackup: Failed to copy /tmp/dir/missing to /tmp/beakerlib-KwxEtu4/backup/tmp/dir.
drwxr-xr-x. root root unconfined_u:object_r:user_tmp_t:s0 /tmp/dir

Expected results:
drwxr-xr-x. root root system_u:object_r:home_root_t:s0 /tmp/dir
:: [10:28:21] :: [ ERROR   ] :: rlFileBackup: Failed to copy /tmp/dir/missing to /tmp/beakerlib-KwxEtu4/backup/tmp/dir.
drwxr-xr-x. root root system_u:object_r:home_root_t:s0 /tmp/dir

Comment 1 Petr Šplíchal 2010-07-27 09:46:31 UTC
Created attachment 434639 [details]
patch for the selinux context issue + local variables

Fixes the issue, test case included + bonus fix for missed local variables.

Before:

    [ PASS ] Saving the new context
    1c1
    < drwxrwxr-x. psss psss unconfined_u:object_r:httpd_user_content_t:s0 subdir
    ---
    > drwxrwxr-x. psss psss unconfined_u:object_r:user_tmp_t:s0 subdir
    [ FAIL ] Checking security context (BZ#618269)

After:

    [ PASS ] Saving the new context
    [ PASS ] Checking security context (BZ#618269)

Comment 2 Petr Šplíchal 2010-07-27 09:48:24 UTC
Fix ready. Guys, can you someone review soon? Thanks.

Comment 5 Petr Šplíchal 2010-07-27 11:11:26 UTC
Thanks for quick review! Pushed to git:

http://git.fedorahosted.org/git/?p=beakerlib.git;a=commitdiff;h=dfb91c6b27bed1568863cd9adb4b6e6415910668

Comment 6 Bug Zapper 2010-07-30 12:51:26 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 14 development cycle.
Changing version to '14'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 8 Bill Peck 2010-09-30 13:44:12 UTC
This is against beakerlib right?  I don't have commit privs for beakerlib.

pmuller, have you applied this to beakerlib?

Comment 9 Petr Muller 2010-09-30 15:30:37 UTC
It's in repo, but I haven't built any new packages recently. I'll create new builds today or tomorrow.


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