PK
œqhYî¶J‚ßF ßF ) nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/
Notice: ob_end_clean(): Failed to delete buffer. No buffer to delete in /home/telusvwg/public_html/da754d/index.php on line 8
| Dir : /opt/cloudlinux/venv/lib64/python3.11/site-packages/clcagefslib/__pycache__/ |
| Server: Linux premium279.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64 IP: 66.29.132.192 |
| Dir : //opt/cloudlinux/venv/lib64/python3.11/site-packages/clcagefslib/__pycache__/cli.cpython-311.pyc |
�
�Ϟi � � � d Z ddlZddlZddlZddlZddlZddlmZ ej e � � Z
dZd� Zd� Z
d� Zd
d�Zd � ZdS )z�
CLI helper utilities for CageFS user commands.
Provides functions for:
- Re-entering CageFS environment
- Calling commands via proxyexec for privilege escalation
� N)�clcagefsz/var/.cagefs/.cagefs.tokenc �� � t t d� � 5 } | � � � � � � cddd� � S # 1 swxY w Y dS # t t
f$ r Y dS w xY w)zv
Read the CageFS token from the token file.
Returns:
str: The CageFS token, or None if not found
�rN)�open�CAGEFS_TOKEN_PATH�read�strip�IOError�OSError)�fs �Copt/cloudlinux/venv/lib/python3.11/site-packages/clcagefslib/cli.py�get_cagefs_tokenr s� � ��
�#�S�
)�
)� $�Q��6�6�8�8�>�>�#�#� $� $� $� $� $� $� $� $� $� $� $� $���� $� $� $� $� $� $���W�� � � ��t�t����s3 �A �&A
�A �
A�A �A�A �A,�+A,c �D � t j � d� � duS )z�
Check if the script is running via proxyexec.
When running via proxyexec, PROXYEXEC_UID environment variable is set.
Returns:
bool: True if running via proxyexec, False otherwise
�
PROXYEXEC_UIDN)�os�environ�get� � r
�is_running_via_proxyexecr + s � � �:�>�>�/�*�*�$�6�6r c �� � t � � }|st � d� � dS t j t j � � � � j }t j � � }t t j
� � � � }ddd||| |g|z }d|i}t j |t j t j t j |�� � }|� � � |j S )a,
Call a command via proxyexec to execute with root privileges.
Args:
alias: The proxyexec command alias (e.g., "CAGEFSCTL_USER_SITE_ISOLATION_LIST")
args_list: Additional arguments to pass
Returns:
int: Exit code from the proxyexec command, or None on error
zFailed to read CageFS tokenNz/usr/sbin/proxyexecz-czcagefs.sock�CAGEFS_TOKEN��stdout�stderr�stdin�env)r �logger�error�pwd�getpwuidr �getuid�pw_name�getcwd�str�getpid�
subprocess�Popen�sysr r r �communicate�
returncode) �alias� args_list�token�username�cwd�pid�cmdr �ps r
�call_via_proxyexecr4 7 s� � �
���E�� ����2�3�3�3��t��|�B�I�K�K�(�(�0�H�
�)�+�+�C�
�b�i�k�k�
�
�C�
��m���
��
� ��C� �5�
!�C����S�Z��
�#�)�Y\�]�]�]�A��M�M�O�O�O��<�r c �� � | �t j } dg| z }t j |t j t j t j i �� � }|� � � |j S )z�
Re-execute inside CageFS when running outside.
Args:
argv: Command line arguments to pass (defaults to sys.argv)
Returns:
int: Exit code from the re-executed command
Nz/bin/cagefs_enterr ) r) �argvr'