File: //usr/share/setroubleshoot/plugins/__pycache__/catchall_boolean.cpython-36.opt-1.pyc
3
nm�a� � @ s\ d dl Z d dlZd dlZe jddd�Zej Zd dlT d dlmZ d dlZG dd� de�Z dS ) � Nzsetroubleshoot-pluginsT)Zfallback)�*)�Pluginc @ sP e Zd Zed�Zed�Zed�ZdZdd� Zdd� Z d d
� Z
dd� Zd
d� ZdS )�pluginzN
SELinux is preventing $SOURCE_PATH "$ACCESS" access on $TARGET_PATH.
a:
SELinux denied access requested by $SOURCE. The current boolean
settings do not allow this access. If you have not setup $SOURCE to
require this access this may signal an intrusion attempt. If you do intend
this access you need to change the booleans on this system to allow
the access.
z�
Confined processes can be configured to run requiring different access, SELinux provides booleans to allow you to turn on/off
access as needed.
� c C s t j| t� | jd� d| _d S )N� Zyellow)r �__init__�__name__Zset_priority�level)�self� r �5/usr/share/setroubleshoot/plugins/catchall_boolean.pyr 6 s
zplugin.__init__c C sH t j|d �}t|tj�s(tj|dd�}td�|d j� |dd � S )Nr �utf8)�encodingzIf you want to %s� )�sepolicyZboolean_desc�
isinstance�sixZ text_type�_�lower)r
�avc�argsZtxtr r r �get_if_text; s zplugin.get_if_textc C s t d�|d |d f S )Nzsetsebool -P %s %sr r )r )r
r r r r r �get_do_textA s zplugin.get_do_textc C sV t d�|d }y,|d r:|d dkr:|t d�|d 7 }W n tk
rP Y nX |S )Nz?You must tell SELinux about this by enabling the '%s' boolean.
r � �Nonez,You can read '%s' man page for more details.)r �
IndexError)r
r r �textr r r �
get_then_textD s zplugin.get_then_textc C sv | j |jj�}t|j�dkrrg }| j}d}|j}x<|D ]4}|sL| j |d �}|j| j|d |d |f�� q6W |S d S )Nr r r )Z
check_for_manZscontext�type�len�bools�fix_description�appendZreport)r
r Zman_pageZreportsZfix�fix_cmdr �br r r �analyzeN s
"zplugin.analyzeN)
r �
__module__�__qualname__r ZsummaryZproblem_descriptionr! r# r r r r r% r r r r r s
r )
�gettext�osr Ztranslationr Zsetroubleshoot.utilZsetroubleshoot.Pluginr r r r r r r �<module> s