관리-도구
편집 파일: objclassquery.cpython-39.opt-1.pyc
a ����q�qe ����������������������@���s����d�dl�Z�d�dlZd�dlmZ�d�dlmZ�ddlmZmZ�ddl m Z �ddlmZ�ddl mZ�dd lmZ�dd lmZmZ�G�dd��dee�ZdS�) �����N)�suppress)�Iterable����)�CriteriaDescriptor�CriteriaSetDescriptor)�NoCommon)� MatchName)�ObjClass)�PolicyQuery)�match_regex�match_regex_or_setc�����������������������s|���e�Zd�ZU�dZedd�ZdZeed<�e d�Z dZeed<�dZeed<�dZ eed<�d d ���fdd�Zee�d �d d�Z���ZS�)� ObjClassQueryaO�� Query object classes. Parameter: policy The policy to query. Keyword Parameters/Class attributes: name The name of the object set to match. name_regex If true, regular expression matching will be used for matching the name. common The name of the inherited common to match. common_regex If true, regular expression matching will be used for matching the common name. perms The permissions to match. perms_equal If true, only commons with permission sets that are equal to the criteria will match. Otherwise, any intersection will match. perms_regex If true, regular expression matching will be used on the permission names instead of set logic. comparison will not be used. perms_indirect If false, permissions inherited from a common permission set not will be evaluated. Default is true. �common_regexZ lookup_commonF�perms_regex�perms_equalT�perms_indirectN)�returnc��������������������s(���t�t|��j|fi�|���t�t�|�_d�S�)N)�superr ����__init__�loggingZ getLogger�__name__�log)�self�policy�kwargs�� __class__���;/usr/lib64/python3.9/site-packages/setools/objclassquery.pyr���6���s����zObjClassQuery.__init__c�������������� ���c���s����|�j��d�|����|��|�j���|�j��d�|����|�j��d�|����|�j���D�]�}|��|�s\qL|�jr�zt |j|�j|�j �szW�qLW�n�ty����Y�qLY�n0�|�jr�|j}|�j r�tt���||jjO�}W�d����n1�s�0����Y��t||�j|�j|�j�s�qL|V��qLdS�)z3Generator which yields all matching object classes.z/Generating object class results from {0.policy}z-Common: {0.common!r}, regex: {0.common_regex}z[Perms: {0.perms}, regex: {0.perms_regex}, eq: {0.perms_equal}, indirect: {0.perms_indirect}N)r����info�formatZ_match_name_debug�debugr����classesZ_match_name�commonr���r���r����permsr���r���r���r���r���)r����class_r$���r���r���r����results:���s@���� � � *�zObjClassQuery.results)r���� __module__�__qualname__�__doc__r���r#���r����bool�__annotations__r���r$���r���r���r���r���r���r ���r&���� __classcell__r���r���r���r���r ������s��� r ���)r����re� contextlibr����typingr���Zdescriptorsr���r���� exceptionr���Zmixinsr���Z policyrepr ����queryr ����utilr���r���r ���r���r���r���r����<module>���s���