Mini Shell
3
C��eZd � @ s2 d dl Z d dlmZ d dlmZ d dlmZmZ d dlmZ d dl m
Z
e
e�Zdd� Z
G d d
� d
e�Ze� ZG dd� de�ZG d
d� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd � d e�ZG d!d"� d"e�ZdS )#� N)�Signal)�_)� constants�regexes)�users)�get_module_loggerc C s | j jj|�}|s| j j� }|S )z�Get a policy corresponding to the name or default policy.
If no policy is found for the name the default policy is returned.
)ZanacondaZpwpolicy�
get_policyZPwPolicyData)Zkickstart_dataZpolicy_name�policy� r
�&/usr/lib64/python3.6/input_checking.pyr s
r c @ s e Zd ZdZdd� Zdd� ZdS )�PwqualitySettingsCachea1 Cache for libpwquality settings used for password validation.
Libpwquality settings instantiation is probably not exactly cheap
and we might need the settings for checking every password (even when
it is being typed by the user) so it makes sense to cache the objects
for reuse. As there might be multiple active policies for different
passwords we need to be able to cache multiple policies based on
minimum password length, as we don't input anything else to libpwquality
than minimum password length and the password itself.
c C s
i | _ d S )N)�
_pwq_settings)�selfr
r
r �__init__6 s zPwqualitySettingsCache.__init__c C s8 | j j|�}|d kr4tj� }|j� ||_|| j |<