| 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/utils/__pycache__/ |
Upload File : |
o
;j�R � @ s� d Z ddlZddlZddlZddlZddlZddlZddlmZ z,ddl Z ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlZdZW n eyW dZY nw e�e�Zddd�Zd d
� Zdd� Zddd�Zddd�Zddd�ZdS )aV
Run child processes as another Windows user.
The main entry points are :func:`runas` (starts the child with
``CreateProcessWithTokenW`` when the minion can obtain a privileged context) and
:func:`runas_unpriv` (uses ``CreateProcessWithLogonW`` as a fallback). Both are
used from :mod:`salt.modules.cmdmod` when ``runas`` is set on Windows.
� N)�CommandExecutionErrorTF�� c C s6 t | t�r| nt| �}t|�|kr|d|� d S |S )aI
Shorten a command line for safe logging (full line is never executed from
this helper).
Args:
cmd: Command string; non-strings are formatted with ``repr()``.
max_len: Maximum length before truncation; an ellipsis is appended.
Returns:
Truncated string suitable for debug log lines.
Nu …)�
isinstance�str�repr�len)�cmdZmax_len�s� r
�H/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/win_runas.py�_preview_cmd* s r c C s t sdS dS )z�
Load this module only when PyWin32 (and related imports) succeeded.
Returns:
The string ``win_runas`` on success, or ``(False, reason)`` when
required imports failed so the loader should skip the module.
)FzThis utility requires pywin32Z win_runas)� HAS_WIN32r
r
r
r �__virtual__>