%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/modules/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/modules/bsd_shadow.pyo

�
���^c@@s�dZddlmZmZmZyddlZWnek
rEnXddlmZddl	Z
ddlZ
ddlm
Z
dZd�Zd�Zd	�Zd
�Zd�Zd�Zd
�ZdS(u0
Manage the password database on BSD systems

.. 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>`.
i(tabsolute_importtprint_functiontunicode_literalsN(tsix(tSaltInvocationErrorushadowcC@s&dtjdd�krtStdfS(NuBSDuosuuWThe bsd_shadow execution module cannot be loaded: only available on BSD family systems.(t
__grains__tgett__virtualname__tFalse(((s;/usr/lib/python2.7/site-packages/salt/modules/bsd_shadow.pyt__virtual__scC@stdj�dkrdSdS(u�
    Returns the default hash used for unset passwords

    CLI Example:

    .. code-block:: bash

        salt '*' shadow.default_hash
    uosufreebsdu*u
*************(Rtlower(((s;/usr/lib/python2.7/site-packages/salt/modules/bsd_shadow.pytdefault_hash$s
cC@sy-tj|�}i|jd6|jd6}Wn tk
rOidd6dd6SXt|tj�sttj|�}nd|kr�t	dj
|���ntdd�r�tddd	d
|gdt�j
d�dd
!\}}n�tddkr�y�tjjjdd���}xx|D]p}tjjj|�}|jdj
|��r|j
d�}|dd
!\}}tj|d�|d<PqqWWdQXWq�tk
r�d}}q�Xn
d}}yt|�|d<Wntk
r�nXyt|�|d<Wntk
r
nX|S(u�
    Return information for the specified user

    CLI Example:

    .. code-block:: bash

        salt '*' shadow.info someuser
    unameupasswduu:uInvalid username '{0}'ucmd.has_execupwucmd.run_stdoutuuserushowtpython_shelliiukerneluNetBSDuOpenBSDu/etc/master.passwduru{0}:iNuchangeuexpire(uNetBSDuOpenBSD(tpwdtgetpwnamtpw_namet	pw_passwdtKeyErrort
isinstanceRtstring_typest	text_typeRtformatt__salt__RtsplitRtsalttutilstfilestfopentstringutilst
to_unicodet
startswithtIOErrortNonetintt
ValueError(tnametdatatrettchangetexpiretfp_tlinetkey((s;/usr/lib/python2.7/site-packages/salt/modules/bsd_shadow.pytinfo1sN


	"




cC@s�t|�}||dkr tStddkrKddd|d|g}ndd||g}td	|d
t�t|�}|d|dkr�|d|kSdS(uE
    Sets the time at which the password expires (in seconds since the UNIX
    epoch). See ``man 8 usermod`` on NetBSD and OpenBSD or ``man 8 pw`` on
    FreeBSD.

    A value of ``0`` sets the password to never expire.

    CLI Example:

    .. code-block:: bash

        salt '*' shadow.set_change username 1419980400
    uchangeukerneluFreeBSDupwuuserumodu-fuusermoducmd.runRN(R+tTrueRRR(R#R&tpre_infotcmdt	post_info((s;/usr/lib/python2.7/site-packages/salt/modules/bsd_shadow.pyt
set_changejscC@s�t|�}||dkr tStddkrKddd|d|g}ndd||g}td	|d
t�t|�}|d|dkr�|d|kSdS(uC
    Sets the time at which the account expires (in seconds since the UNIX
    epoch). See ``man 8 usermod`` on NetBSD and OpenBSD or ``man 8 pw`` on
    FreeBSD.

    A value of ``0`` sets the account to never expire.

    CLI Example:

    .. code-block:: bash

        salt '*' shadow.set_expire username 1419980400
    uexpireukerneluFreeBSDupwuuserumodu-euusermoducmd.runRN(R+R,RRR(R#R'R-R.R/((s;/usr/lib/python2.7/site-packages/salt/modules/bsd_shadow.pyt
set_expire�scC@s>dj|�}td|dtdd�t|�}|dS(u�
    .. versionadded:: 2015.8.2

    Delete the password from name user

    CLI Example:

    .. code-block:: bash

        salt '*' shadow.del_password username
    upw user mod {0} -w noneucmd.runRtoutput_logleveluquietupasswd(RRRR+(R#R.tuinfo((s;/usr/lib/python2.7/site-packages/salt/modules/bsd_shadow.pytdel_password�scC@s�tjdd�dkr9ddd|ddg}|}nd	d
||g}d}td|d|d
ddt�t|�d|kS(u	
    Set the password for a named user. The password must be a properly defined
    hash. The password hash can be generated with this command:

    ``python -c "import crypt; print crypt.crypt('password', ciphersalt)"``

    .. note::
        When constructing the ``ciphersalt`` string, you must escape any dollar
        signs, to avoid them being interpolated by the shell.

    ``'password'`` is, of course, the password for which you want to generate
    a hash.

    ``ciphersalt`` is a combination of a cipher identifier, an optional number
    of rounds, and the cryptographic salt. The arrangement and format of these
    fields depends on the cipher and which flavor of BSD you are using. For
    more information on this, see the manpage for ``crpyt(3)``. On NetBSD,
    additional information is available in ``passwd.conf(5)``.

    It is important to make sure that a supported cipher is used.

    CLI Example:

    .. code-block:: bash

        salt '*' shadow.set_password someuser '$1$UYCIxa628.9qXjpQCjM4a..'
    uosuuFreeBSDupwuuserumodu-Hu0uusermodu-pucmd.runtstdinR2uquietRupasswdN(RRR RRR+(R#tpasswordR.R5((s;/usr/lib/python2.7/site-packages/salt/modules/bsd_shadow.pytset_password�s	
(t__doc__t
__future__RRRR
tImportErrortsalt.extRtsalt.utils.filesRtsalt.utils.stringutilstsalt.exceptionsRRR	RR+R0R1R4R7(((s;/usr/lib/python2.7/site-packages/salt/modules/bsd_shadow.pyt<module>
s"
		
	9			

Zerion Mini Shell 1.0