File: //usr/share/setroubleshoot/plugins/restorecon.pyc
�
c�L]c @ s� d d l Z e j d d e �Z e j Z d d l Td d l m Z d d l Z d d l Td d l Z d a d � Z d g Z
d � Z d d l Z d e f d
� � YZ d S( i����Ns setroubleshoot-pluginst fallback( t *( t Pluginc C sD t s: t t j � � } | j � j d � a | j � n | t k S( Ns
( t customizable_typest opent selinuxt selinux_customizable_types_patht readt splitt close( t targett fd( ( s/ /usr/share/setroubleshoot/plugins/restorecon.pyt customizable s
s /sys/fsc C s( x! t D] } | j | � r t Sq Wt S( N( t excluded_pathst
startswitht Truet False( t target_patht path( ( s/ /usr/share/setroubleshoot/plugins/restorecon.pyt
excluded_path, s
t pluginc B sl e Z e d � Z d Z e d � Z d � Z e d � Z d � Z e d d � Z d Z
d � Z d
� Z RS( sN
SELinux is preventing $SOURCE_PATH "$ACCESS" access to $TARGET_PATH.
s /sbin/restorecon $TARGET_PATHs�
You can restore the default system context to this file by executing the
restorecon command. restorecon '$TARGET_PATH', if this file is a directory,
you can recursively restore using restorecon -R '$TARGET_PATH'.
c C s t d � | d S( Ns�
SELinux denied access requested by $SOURCE. $TARGET_PATH may
be mislabeled. $TARGET_PATH default SELinux type is
<B>%s</B>, but its current type is <B>$TARGET_TYPE</B>. Changing
this file back to the default type may fix your problem.
<p>
File contexts can be assigned to a file in the following ways.
<ul>
<li>Files created in a directory receive the file context of the parent directory by default.
<li>The SELinux policy might override the default label inherited from the parent directory by
specifying a process running in context A which creates a file in a directory labeled B
will instead create the file with label C. An example of this would be the dhcp client running
with the dhclient_t type and creating a file in the directory /etc. This file would normally
receive the etc_t type due to parental inheritance but instead the file
is labeled with the net_conf_t type because the SELinux policy specifies this.
<li>Users can change the file context on a file using tools such as chcon, or restorecon.
</ul>
This file could have been mislabeled either by user error, or if an normally confined application
was run under the wrong domain.
<p>
However, this might also indicate a bug in SELinux because the file should not have been labeled
with this type.
<p>
If you believe this is a bug, please file a bug report against this package.
i ( t _( t selft avct args( ( s/ /usr/share/setroubleshoot/plugins/restorecon.pyt get_problem_description? s sG If you want to fix the label.
$TARGET_PATH default label should be %s.c C s | j | d S( Ni ( t if_text( R R R ( ( s/ /usr/share/setroubleshoot/plugins/restorecon.pyt get_if_text\ s sT you can run restorecon. The access attempt may have been stopped due to insufficientsh permissions to access a parent directory in which case try to change the following command accordingly.s"