509318396
Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­
<!DOCTYPE html>
<html>
3
í«„^·  ã               @   sb   d dl Z d dlZddlmZmZ ddlmZ ddlmZ ddl	m
Z
mZmZ G dd„ deeƒZdS )	é    Né   )ÚCriteriaDescriptorÚCriteriaSetDescriptor)Ú	MatchName)ÚPolicyQuery)Úmatch_regex_or_setÚmatch_levelÚmatch_rangec                   sj   e Zd ZdZedd�ZdZdZdZedd�Z	dZ
dZdZdZeddƒZdZdZ‡ fdd	„Zd
d„ Z‡  ZS )Ú	UserQueryaf  
    Query SELinux policy users.

    Parameter:
    policy            The policy to query.

    Keyword Parameters/Class attributes:
    name            The user name to match.
    name_regex      If true, regular expression matching
                    will be used on the user names.
    roles           The attribute to match.
    roles_equal     If true, only types with role sets
                    that are equal to the criteria will
                    match.  Otherwise, any intersection
                    will match.
    roles_regex     If true, regular expression matching
                    will be used on the role names instead
                    of set logic.
    level           The criteria to match the user's default level.
    level_dom       If true, the criteria will match if it dominates
                    the user's default level.
    level_domby     If true, the criteria will match if it is dominated
                    by the user's default level.
    level_incomp    If true, the criteria will match if it is incomparable
                    to the user's default level.
    range_          The criteria to match the user's range.
    range_subset    If true, the criteria will match if it is a subset
                    of the user's range.
    range_overlap   If true, the criteria will match if it overlaps
                    any of the user's range.
    range_superset  If true, the criteria will match if it is a superset
                    of the user's range.
    range_proper    If true, use proper superset/subset operations.
                    No effect if not using set operations.
    Zlookup_level)Zlookup_functionFZlookup_rangeÚroles_regexZlookup_rolec                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/userquery.pyr   O   s    zUserQuery.__init__c             c   sê   | j jdj| ƒƒ | j| j ƒ | j jdj| ƒƒ | j jdj| ƒƒ | j jdj| ƒƒ x�| jjƒ D ]‚}| j|ƒspq`| jr�t	|j| j| j
| jƒ r�q`| jr´t|j| j| j| j| jƒ r´q`| jrÜt|j| j| j| j| j| jƒ rÜq`|V  q`W dS )z*Generator which yields all matching users.z'Generating user results from {0.policy}z?Roles: {0.roles!r}, regex: {0.roles_regex}, eq: {0.roles_equal}zXLevel: {0.level!r}, dom: {0.level_dom}, domby: {0.level_domby}, incomp: {0.level_incomp}z�Range: {0.range_!r}, subset: {0.range_subset}, overlap: {0.range_overlap}, superset: {0.range_superset}, proper: {0.range_proper}N)r   ÚinfoÚformatZ_match_name_debugÚdebugr   ZusersZ_match_nameÚrolesr   Úroles_equalr   Úlevelr   Z	mls_levelÚ	level_domÚlevel_dombyÚlevel_incompÚrange_r	   Z	mls_rangeÚrange_subsetÚrange_overlapÚrange_supersetÚrange_proper)r   Úuserr   r   r   ÚresultsS   sB    






zUserQuery.results)r   Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r    r"   r!   r#   r$   r   r   r   r   r   r&   Ú__classcell__r   r   )r   r   r
      s   $


r
   )r   ÚreZdescriptorsr   r   Zmixinsr   Zqueryr   Úutilr   r   r	   r
   r   r   r   r   Ú<module>   s   