
Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­
<!DOCTYPE html>
<html>
3
í«„^ì	  ã               @   sV   d dl Z d dlZddlmZ ddlmZ ddlmZ ddlm	Z	 G dd„ deeƒZ
dS )	é    Né   )ÚCriteriaSetDescriptor)Ú	MatchName)ÚPolicyQuery)Úmatch_regex_or_setc                   s:   e Zd ZdZeddƒZdZdZ‡ fdd„Zdd„ Z	‡  Z
S )	Ú	RoleQuerya†  
    Query SELinux policy roles.

    Parameter:
    policy            The policy to query.

    Keyword Parameters/Class attributes:
    name         The role name to match.
    name_regex   If true, regular expression matching
                 will be used on the role names.
    types        The type to match.
    types_equal  If true, only roles with type sets
                 that are equal to the criteria will
                 match.  Otherwise, any intersection
                 will match.
    types_regex  If true, regular expression matching
                 will be used on the type names instead
                 of set logic.
    Útypes_regexZlookup_typeFc                s$   t t| ƒj|f|Ž tjtƒ| _d S )N)Úsuperr   Ú__init__ÚloggingZ	getLoggerÚ__name__Úlog)ÚselfÚpolicyÚkwargs)Ú	__class__© ú!/usr/lib64/python3.6/rolequery.pyr
   6   s    zRoleQuery.__init__c             c   s€   | j jdj| ƒƒ | j| j ƒ | j jdj| ƒƒ xJ| jjƒ D ]<}| j|ƒsLq<| jrrt	t
|jƒ ƒ| j| j| jƒ rrq<|V  q<W dS )z*Generator which yields all matching roles.z'Generating role results from {0.policy}z?Types: {0.types!r}, regex: {0.types_regex}, eq: {0.types_equal}N)r   ÚinfoÚformatZ_match_name_debugÚdebugr   ZrolesZ_match_nameÚtypesr   ÚsetÚtypes_equalr   )r   Úrr   r   r   Úresults:   s    



zRoleQuery.results)r   Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r
   r   Ú__classcell__r   r   )r   r   r      s   
r   )r   ÚreZdescriptorsr   Zmixinsr   Zqueryr   Úutilr   r   r   r   r   r   Ú<module>   s   