403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /lib64/python3.9/site-packages/setools/checker/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /lib64/python3.9/site-packages/setools/checker/__pycache__/descriptors.cpython-39.pyc
a

q�qe��@shddlZddlmZmZddlmZddlmZmZGdd�de�Z	Gdd	�d	e�Z
Gd
d�de�ZdS)�N)�Callable�Union�)�InvalidCheckValue)�CriteriaDescriptor�CriteriaPermissionSetDescriptorcs<eZdZdZeeefdd��fdd�Z�fdd�Z�Z	S)�ConfigDescriptoraU
    Single item configuration option descriptor.

    Parameter:
    lookup_function The name of the SELinuxPolicy lookup function,
                    e.g. lookup_type or lookup_boolean.

    Read-only instance attribute use (obj parameter):
    checkname       The name of the check.
    policy          The instance of SELinuxPolicy
    N)�lookup_function�returncst�j|d�dS)N)r	)�super�__init__)�selfr	��	__class__��A/usr/lib64/python3.9/site-packages/setools/checker/descriptors.pyrszConfigDescriptor.__init__c
sh|sd|j|<nTzt��||���Wn<tyb}z$td�|j|j|��|�WYd}~n
d}~00dS)N�{}: Invalid {} setting: {})	�	instancesr�__set__�strip�
ValueErrorr�format�	checkname�name�r
�obj�value�exrrrrs
��zConfigDescriptor.__set__)
�__name__�
__module__�__qualname__�__doc__rr�strrr�
__classcell__rrrrrsrcs>eZdZdZd
eeefeedd��fdd�
Zdd	�Z	�Z
S)�ConfigSetDescriptora
    Descriptor for a configuration option set.

    Parameter:
    lookup_function The name of the SELinuxPolicy lookup function,
                    e.g. lookup_type or lookup_boolean.

    Keyword Parameters:
    strict          (Bool) If True, all objects must exist in the policy
                    when setting the value.  If False, any objects that
                    fail the policy lookup will be dropped instead of raising
                    an exception.  The default is True.
    expand          (Bool) If True, each object will be expanded.  Default
                    is False.

    Read-only instance attribute use (obj parameter):
    checkname       The name of the check.
    log             A logger instance.
    policy          The instance of SELinuxPolicy
    TFN)r	�strict�expandr
cs"t�j|t�d�||_||_dS)N)r	�
default_value)rr�	frozensetr%r&)r
r	r%r&rrrr?szConfigSetDescriptor.__init__c	Cs|st�|j|<�n|j}t|j�r,|j}nt|j|j�}t�}dd�t�	d|�D�D]�}z,||�}|j
rz|�|�
��n
|�|�WqVt
�y}zd|jr�|�d�|j|��|jd|d�td�|j|j|��|�|�d�|j|j|��WYd}~qVd}~00qVt|�|j|<dS)Ncss|]}|r|VqdS�Nr)�.0�irrr�	<genexpr>P�z.ConfigSetDescriptor.__set__.<locals>.<genexpr>z\szInvalid {} item: {}z
Traceback:)�exc_infoz{}: Invalid {} item: {})r(r�log�callabler	�getattrZpolicy�set�re�splitr&�update�addrr%�errorrr�debugrr�info)	r
rrr/�lookup�ret�item�o�errrrFs4

��
�zConfigSetDescriptor.__set__)TF)rrr r!rrr"�boolrrr#rrrrr$(s��r$cs2eZdZdZdd��fdd�Z�fdd�Z�ZS)�ConfigPermissionSetDescriptoraJ
    Descriptor for a configuration permissions set.

    Read-only instance attribute use (obj parameter):
    checkname       The name of the check.
    policy          The instance of SELinuxPolicy
    tclass          If it exists, it will be used to validate the
                    permissions.  See validate_perms_any()
    N)r
cst�jt�d�dS)N)r')rrr()r
rrrrpsz&ConfigPermissionSetDescriptor.__init__c
sv|st�|j|<n`z"t��|dd�|�d�D��Wn<typ}z$td�|j|j	|��|�WYd}~n
d}~00dS)Ncss|]}|r|VqdSr)r)r*�vrrrr,xr-z8ConfigPermissionSetDescriptor.__set__.<locals>.<genexpr>� r)
r(rrrr4rrrrrrrrrrss"
��z%ConfigPermissionSetDescriptor.__set__)rrr r!rrr#rrrrr@ds
r@)r3�typingrr�	exceptionrZdescriptorsrrrr$r@rrrr�<module>s<

Youez - 2016 - github.com/yon3zu
LinuXploit