a yÊbZ ã @ s€ d dl Z e jdddZej Zd dlT d dlmZ d dlZd dlT d dlZda dd„ Z g d ¢Zd d„ Zd dlZG dd „ d eƒZ dS )é Nzsetroubleshoot-pluginsT)Zfallback)Ú*)ÚPluginc C s. t s&tt ¡ ƒ}| ¡ d¡a | ¡ | t v S )NÚ )Úcustomizable_typesÚopenÚselinuxZselinux_customizable_types_pathÚreadÚsplitÚclose)ÚtargetÚfd© r ú//usr/share/setroubleshoot/plugins/restorecon.pyÚcustomizable s r )z/sys/z/proc/z/memfd:c C s t D ]}| |¡r dS qdS )NTF)Úexcluded_pathsÚ startswith)Ztarget_pathÚpathr r r Ú excluded_path, s r c @ sT e Zd ZedƒZdZedƒZdd„ ZedƒZdd„ Z ed ƒZ d Zdd„ Zd d„ 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. é )Ú_©ÚselfÚavcÚargsr 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_textr r r r Úget_if_text\ s zplugin.get_if_textz¼you can run restorecon. The access attempt may have been stopped due to insufficient 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 | t¡ | d¡ d| _d| _tdƒ| _d S )Néd ZgreenTzRestore Context)r Ú__init__Ú__name__Zset_priorityÚlevelZfixabler Zbutton_text)r r r r r d s zplugin.__init__c C s: |j s d S |jjdv rd S |jjtvr*d S | d¡r8d S i }t|d<