dbfdg 3 nmaG @ s~ d dl Z e jdddZej Zd dlT d dlmZ d dlZd dlT d dlZda dd Z d gZd d Zd dlZG dd d eZ dS ) Nzsetroubleshoot-pluginsT)Zfallback)*)Pluginc C s. t s&ttj }|j jda |j | t kS )N )customizable_typesopenselinuxZselinux_customizable_types_pathreadsplitclose)targetfd r //usr/share/setroubleshoot/plugins/restorecon.pycustomizable s r z/sys/fsc C s xt D ]}| j|rdS qW dS )NTF)excluded_paths startswith)Ztarget_pathpathr r r excluded_path, s r c @ sT e Zd ZedZdZedZdd ZedZdd Z edZ dZdd Zdd Z dS )pluginzN SELinux is preventing $SOURCE_PATH "$ACCESS" access to $TARGET_PATH. z/sbin/restorecon $TARGET_PATHz 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 )Na SELinux denied access requested by $SOURCE. $TARGET_PATH may be mislabeled. $TARGET_PATH default SELinux type is %s, but its current type is $TARGET_TYPE. Changing this file back to the default type may fix your problem.
File contexts can be assigned to a file in the following ways.
However, this might also indicate a bug in SELinux because the file should not have been labeled with this type.
If you believe this is a bug, please file a bug report against this package. )_)selfavcargsr r r get_problem_description? s zplugin.get_problem_descriptionzGIf you want to fix the label. $TARGET_PATH default label should be %s.c C s | j |d S )Nr )if_text)r r r r r r get_if_text\ s zplugin.get_if_textzTyou can run restorecon. The access attempt may have been stopped due to insufficientzh permissions to access a parent directory in which case try to change the following command accordingly.z"# /sbin/restorecon -v $TARGET_PATHc C s0 t j| t | jd d| _d| _td| _d S )Nd ZgreenTzRestore Context)r __init____name__Zset_prioritylevelZfixabler Zbutton_text)r r r r r d s zplugin.__init__c C s6 |j s d S |jjdkrd S |jjtkr*d S |jdr8d S i }t|d<