Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 844620 Details for
Bug 1045122
cp -a messes up destination selinux contexts for existing directories
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
proposed fix
cp-a-ctx-dirs.patch (text/plain), 2.03 KB, created by
Pádraig Brady
on 2014-01-02 17:02:38 UTC
(
hide
)
Description:
proposed fix
Filename:
MIME Type:
Creator:
Pádraig Brady
Created:
2014-01-02 17:02:38 UTC
Size:
2.03 KB
patch
obsolete
>From ba02153770cc843f6a222670965d09c26da59547 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com> >Date: Thu, 2 Jan 2014 16:40:58 +0000 >Subject: [PATCH] copy: fix SELinux context preservation for existing > directories > >* src/copy.c (copy_internal): Use the global process context >to set the context of existing directories before they're populated. >This is more consistent with the new directory case, and fixes >a bug for existing directories where we erroneously set the >context to the last copied descendent, rather than to that of >the source directory itself. >--- > src/copy.c | 13 ++++++++++++- > 1 files changed, 12 insertions(+), 1 deletions(-) > >diff --git a/src/copy.c b/src/copy.c >index 0f044d0..2572f3f 100644 >--- a/src/copy.c >+++ b/src/copy.c >@@ -2408,6 +2408,17 @@ copy_internal (char const *src_name, char const *dst_name, > else > { > omitted_permissions = 0; >+ >+ /* For directories, the process global context could be reset for >+ descendents, so use it to set the context for existing dirs here. >+ This will also give earlier indication of failure to set ctx. */ >+ if (x->set_security_context || x->preserve_security_context) >+ if (! set_file_security_ctx (dst_name, x->preserve_security_context, >+ false, x)) >+ { >+ if (x->require_preserve_context) >+ goto un_backup; >+ } > } > > /* Decide whether to copy the contents of the directory. */ >@@ -2598,7 +2609,7 @@ copy_internal (char const *src_name, char const *dst_name, > > /* With -Z or --preserve=context, set the context for existing files. > Note this is done already for copy_reg() for reasons described therein. */ >- if (!new_dst && !x->copy_as_regular >+ if (!new_dst && !x->copy_as_regular && !S_ISDIR (src_mode) > && (x->set_security_context || x->preserve_security_context)) > { > if (! set_file_security_ctx (dst_name, x->preserve_security_context, >-- >1.7.7.6 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1045122
:
844440
| 844620