403Webshell
Server IP : 172.24.0.40  /  Your IP : 216.73.216.10
Web Server : Apache
System : Linux dbweb26.ust.edu.ph 4.18.0-513.5.1.el8_9.x86_64 #1 SMP Fri Sep 29 05:21:10 EDT 2023 x86_64
User : apache ( 48)
PHP Version : 8.2.18
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib64/python3.6/site-packages/setools/diff/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib64/python3.6/site-packages/setools/diff/__pycache__/users.cpython-36.pyc
3

�^��	@s�ddlmZmZddlmZddlmZddlmZm	Z	ddl
mZmZddl
mZed	d
ddd
dddg�Zee�Zdd�ZGdd�de�ZdS)�)�defaultdict�
namedtuple�)�MLSDisabled�)�DiffResultDescriptor)�
Difference�
SymbolWrapper)�LevelWrapper�RangeWrapper)�role_wrapper_factoryZ
modified_user�added_roles�
removed_roles�
matched_roles�added_level�
removed_level�added_range�
removed_rangecCs>yt|j|Stk
r8t|�}|t|j|<|SXdS)z|
    Wrap users from the specified policy.

    This caches results to prevent duplicate wrapper
    objects in memory.
    N)�_users_cacheZpolicy�KeyErrorr	)�user�r�r�/usr/lib64/python3.6/users.py�user_wrapper_factory)src@s8eZdZdZed�Zed�Zed�Zdd�Zdd�Z	dS)�UsersDifferencez7Determine the difference in users between two policies.�
diff_userscCs�|jjdj|��|jdd�|jj�D�dd�|jj�D��\|_|_}t	�|_
�x:|D�]0\}}|jdd�|jD�dd�|jD��\}}}y$t|j
�}t|j�}|j
}	|j}
Wn$tk
r�d}d}d}	d}
YnXy$t|j
�}t|j�}|j
}
|j}Wn&tk
�r d}d}d}
d}YnX||k�r6|
}|	}nd}d}||k�rR|}|
}nd}d}|�sp|�sp|�sp|rXt|||||||�|j
|<qXWdS)	z6Generate the difference in users between the policies.zDGenerating user differences from {0.left_policy} to {0.right_policy}css|]}t|�VqdS)N)r)�.0rrrr�	<genexpr>Gsz-UsersDifference.diff_users.<locals>.<genexpr>css|]}t|�VqdS)N)r)rrrrrrHscss|]}t|�VqdS)N)r)rrrrrrRscss|]}t|�VqdS)N)r)rrrrrrSsNzNone (MLS Disabled))�log�info�formatZ	_set_diffZleft_policyZusersZright_policy�added_users�
removed_users�dict�modified_users�rolesr
Z	mls_levelrZ	mls_ranger�modified_users_record)�selfZ
matched_usersZ	left_userZ
right_userr
rrZleft_level_wrapZleft_range_wrapZ
left_levelZ
left_rangeZright_level_wrapZright_range_wrapZright_levelZright_rangerrrrrrrr@s` 









zUsersDifference.diff_userscCs"|jjd�d|_d|_d|_dS)z%Reset diff results on policy changes.zResetting user differencesN)r�debugr"r#r%)r(rrr�_reset_diff�szUsersDifference._reset_diffN)
�__name__�
__module__�__qualname__�__doc__rr"r#r%rr*rrrrr8sGrN)�collectionsrrZ	exceptionrZdescriptorsr�
differencerr	Zmlsr
rr&rr'r$rrrrrrr�<module>s

Youez - 2016 - github.com/yon3zu
LinuXploit