HEX
Server: Apache
System: Linux 185.122.168.184.host.secureserver.net 5.14.0-570.60.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Nov 5 05:00:59 EST 2025 x86_64
User: barbeatleanalyti (1024)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/share/setroubleshoot/plugins/__pycache__/restorecon_source.cpython-39.pyc
a

�Z`�@sdddlZejddd�ZejZddlTddlmZddlZddlTddlZddlZGdd�de�Z	dS)	�Nzsetroubleshoot-pluginsT)Zfallback)�*)�Pluginc@sTeZdZed�ZdZed�Zdd�Zed�Zdd�Z	ed	�Z
d
Zdd�Zd
d�Z
dS)�pluginzN
    SELinux is preventing $SOURCE_PATH "$ACCESS" access to $TARGET_PATH.
    z/sbin/restorecon $SOURCE_PATHz�
    You can restore the default system context to this file by executing the
    restorecon command.  restorecon '$SOURCE_PATH'.
    cCstd�|dS)Nam
    SELinux denied access requested by $SOURCE. $SOURCE_PATH may
    be mislabeled.  $SOURCE_PATH default SELinux type is
    <B>%s</B>, but its current type is <B>$SOURCE_TYPE</B>. Changing
    this file back to the default type may fix your problem.
    <p>
    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.
    �)�_��self�avc�args�r�6/usr/share/setroubleshoot/plugins/restorecon_source.py�get_problem_description,s
�zplugin.get_problem_descriptionzGIf you want to fix the label. 
$SOURCE_PATH default label should be %s.cCs|j|dS)Nr)�if_textrrrr�get_if_text>szplugin.get_if_textzyou can run restorecon.z"# /sbin/restorecon -v $SOURCE_PATHcCs0t�|t�|�d�d|_d|_td�|_dS)N�dZgreenTzRestore
Context)r�__init__�__name__Zset_priority�levelZfixablerZbutton_text)rrrrrDs

zplugin.__init__cCs�|js
dS|jdurdS|jddkr*dSzft�|j�d�t�d}|�d�d}t�|j�d��d}|�d�d}||kr�|�d|f�WSWnt	y�Yn0dS)Nr�/�"r�:�)
Zquery_environmentZspath�selinuxZmatchpathcon�strip�S_IFREG�splitZ
getfileconZreport�OSError)rr	ZmconZ	mcon_typeZgconZ	gcon_typerrr�analyzeKs
zplugin.analyzeN)r�
__module__�__qualname__rZsummaryZfix_cmdZfix_descriptionr
rrZ	then_textZdo_textrrrrrrr sr)
�gettextZtranslationrZsetroubleshoot.utilZsetroubleshoot.Pluginr�os�statrrrrrr�<module>s