Sindbad~EG File Manager

Current Path : /lib/python3.6/site-packages/setroubleshoot/__pycache__/
Upload File :
Current File : //lib/python3.6/site-packages/setroubleshoot/__pycache__/Plugin.cpython-36.opt-1.pyc

3

�h>`��@s�ddlZddlmZmZejedd�edd�dd�Zy
ejZWnek
rXejZYnXddlTddl	Tddl
ZddlZGd	d
�d
e
�ZdS)�N)�parse_config_setting�
get_configZgeneralZi18n_text_domainZi18n_locale_dirT)ZdomainZ	localedirZfallback)�*c@s�eZdZdZdZdZed�ZdZdZ	dd�Z
dd�Zd	d
�Zdd�Z
d
d�Zdd�Zdd�Zdd�Z
ffdd�Zdd�Zdd�Zdd�Zdd�ZdS)�Plugina�
    Each plugin object recognizes one or more access denials and
    presents a description of the denial to the user. Optionally,
    the plugin can provide a suggestion for allowing the access
    to the user.

    There are four user visible strings that are part of each Plugin
    subclass (some or all of these can be changed by the plugin author):
     * summary: summary of the denial
     * problem_description: detailed description of the denial
     * fix_description: description of how to allow the denied access
     * fix_cmd: command that can be used to allow the access

    All of the strings will have a standard set of substitutions performed.
    Each keyword (proceeded by a '$' will be replace by a string) - see
    http://docs.python.org/lib/node109.html for more information. The
    keywords are:
     * $SOURCE_TYPE - type for the source of the avc (usually the
       process performing the operation).
     * $TARGET_TYPE - type for the target of the avc (the type of
       the object).
     * $SOURCE_PATH - source of the executable (from the exe or comm
       field of the exe). A full path is not always available.
     * $TARGET_PATH - path for the target object. A full path is not
       always available.
     * $TARGET_DIR - path of the containing directory for TARGET_PATH.
       Essentially os.path.dirname($TARGET_PATH)
     * $TARGET_CLASS - the object class for the target.
     * $PERMS - the permissions denied.
     * $SOURCE_PACKAGE - name of the package which contains the
       executable (from $SOURCE_PATH).
     * $PORT_NUMBER - the port number for the connection denied.
    Additional subtitutions can be added with set_template_substitutions.

    You can also optional pass the name for a single boolean which will be
    used to set the $BOOLEAN subtitution into Plugin.__init__.
o
    You can also set the level, of the alert, if the plugin believes discovers 
    a signature of an attack, the level should be set to red
    * level:  Defines the level of the alert
    ** yellow default
    ** red Indicates troubleshooter believes machine is being attacked
    ** green Indicates a configuration issue.  Browser will not display Report Bug button
    ** white Tells the troubleshooter to ignore the AVC
        �zdIf you want to allow $SOURCE_BASE_PATH to have $ACCESS access on the $TARGET_BASE_PATH $TARGET_CLASSz
No defaultcCs2tjdd|�|_d|_d|_d|_d|_d|_dS)Nz
^plugins\.r�
ZyellowF)�re�sub�analysis_id�priority�levelZfixableZbutton_textZ
report_bug)�self�name�r�/usr/lib/python3.6/Plugin.py�__init__`szPlugin.__init__cCsdS)Nr)r
�argsrrr�	init_argshszPlugin.init_argscCs|jS)N)�problem_description)r
�avcrrrr�get_problem_descriptionkszPlugin.get_problem_descriptioncCs|jS)N)�if_text)r
rrrrr�get_if_textnszPlugin.get_if_textcCs|jS)N)�	then_text)r
rrrrr�
get_then_textqszPlugin.get_then_textcCs|jS)N)�do_text)r
rrrrr�get_do_texttszPlugin.get_do_textcCs|jS)N)Zfix_cmd)r
rrrrr�get_fix_cmdwszPlugin.get_fix_cmdcCs|jS)N)r)r
rrrrrrzscCst|j|�S)zC
        Report a denial and solution to the fault server.
        )ZSEPluginr
)r
rrrr�report}sz
Plugin.reportcCsdS)NFr)r
rrrr�analyze�szPlugin.analyzecCs
||_dS)N)r)r
rrrr�set_priority�szPlugin.set_prioritycCs|jS)N)r)r
rrr�get_priority�szPlugin.get_prioritycCs*|jd�dd}tjjd|�r&|SdS)N�_rZ_selinuxz/usr/share/man/man8/%s.8.gzr)�split�os�path�isfile)r
rZman_pagerrr�
check_for_man�szPlugin.check_for_manN)�__name__�
__module__�__qualname__�__doc__Zsummaryrr"rrrrrrrrrrrrr r!r'rrrrr,s&-r)�gettextZsetroubleshoot.configrrZtranslationZugettextr"�AttributeErrorZsetroubleshoot.signatureZsetroubleshoot.utilZos.pathr$r�objectrrrrr�<module>s


Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists