File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/win_shadow.cpython-310.pyc
Back
o ;j� � @ s� d Z ddlZddlZddlZddlmZ e�e�Z zddl Z ddlZddlZdZ W n ey4 dZ Y nw dZdd� Zd d � Zdd� Zd d� Zdd� Zdd� Zdd� ZdS )aZ Manage the shadow file .. important:: If you feel that Salt should be using this module to manage passwords on a minion, and it is using a different module (or gives an error similar to *'shadow.info' is not available*), see :ref:`here <module-provider-override>`. :depends: - pywintypes - win32security - winerror � N)�CommandExecutionErrorTFZshadowc C s t jj�� sdS tsdS tS )z' Only works on Windows systems )Fz8Module win_shadow: module only works on Windows systems.)Fz(Module win_shadow: Missing Win32 modules)�salt�utils�platformZ is_windows� HAS_WIN32�__virtualname__� r r �K/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/win_shadow.py�__virtual__% s r c C sN t d | d�}| dddddddd�}|r%|d d|d dddd|d d�}|S ) a Return information for the specified user. .. note:: This just returns dummy data so that salt states can work. Args: name (str): The name of the user account to show. CLI Example: .. code-block:: bash salt '*' shadow.info root � user.info��name� )r �passwdZlstchg�min�max�warnZinact�expirer ZUnavailableZpassword_changed�expiration_date��__salt__)r �info�retr r r r 0 s* ��r c C � t d | |d�S )aa Set the expiration date for a user account. Args: name (str): The name of the user account to edit. expire (str): The date the account will expire. Returns: bool: ``True`` if successful, otherwise ``False``. CLI Example: .. code-block:: bash salt '*' shadow.set_expire <username> 2016/7/1 �user.update)r r )r r r r r � set_expire] � r c C � t d | dd�S )aZ Require the user to change their password the next time they log in. Args: name (str): The name of the user account to require a password change. Returns: bool: ``True`` if successful, otherwise ``False``. CLI Example: .. code-block:: bash salt '*' shadow.require_password_change <username> r T)Zexpiredr r r r r �require_password_changes � r c C r )a Unlocks a user account. Args: name (str): The name of the user account to unlock. Returns: bool: ``True`` if successful, otherwise ``False``. CLI Example: .. code-block:: bash salt '*' shadow.unlock_account <username> r T��unlock_accountr r r r r r! � r r! c C r )aF Set the password for a named user. Args: name (str): The name of the user account. password (str): The new password. Returns: bool: ``True`` if successful, otherwise ``False``. CLI Example: .. code-block:: bash salt '*' shadow.set_password root mysecretpassword r �r �passwordr r"