Uname: Linux dedi-15171674.espacofacial.com.br 5.14.0-687.48.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Sep 16 12:22:07 EDT 2026 x86_64
Software: Apache
PHP version: 8.2.33 [ PHP INFO ] PHP os: Linux
Server Ip: 104.21.5.151
Your Ip: 216.73.216.19
User: espa7358 (1004) | Group: espa7358 (1003)
Safe Mode: OFF
Disable Function:
NONE

name : 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<
© 2026 UnknownSec