File manager - Edit - /opt/cloudlinux/venv/lib/python3.11/site-packages/clcagefslib/webisolation/__pycache__/php.cpython-311.pyc
Back
� ��i� � � � d dl Z d dlZd dlZd dlZd dlmZ d dlmZ d dlZd dl m Z d� Zd� Zde dedz fd �Zd edee ddfd�ZdS ) � N)�Path)�drop_privileges)� jail_utilsc � � t j | |� � n;# t $ r.}t j d| t |� � � � Y d }~dS d }~ww xY wdS )Nz&Failed to terminate process PID %s: %sFT)�os�kill�OSError�logging�error�str)�pid�sig�es ��/builddir/build/BUILDROOT/cagefs-7.6.29-2.el8.cloudlinux.x86_64/opt/cloudlinux/venv/lib/python3.11/site-packages/clcagefslib/webisolation/php.py� _term_processr sj � �� ���S������� � � �� �>��S��V�V�L�L�L��u�u�u�u�u��������� �4s � � A�#A�Ac �d � t j � � dz }t j � � |k rV| rTt | � � D ]+}t j |� � s| � |� � �,t j � � |k r| �Tt | � � D ]}t |t j � � �d S )Ng @)�time�list�psutil� pid_exists�remover �signal�SIGKILL)�pids�timeoutr s r �force_process_killr s� � ��i�k�k�C��G� �)�+�+�� � �D� ���:�:� !� !�C��$�S�)�)� !����C� � � �� �)�+�+�� � �D� � �D�z�z� +� +���c�6�>�*�*�*�*�+� +� r �returnc � � t d| � d�� � } |� � � � � � S # t t t f$ r Y dS w xY w)zq Checks if the process is in the isolated environment. Returns path to process document root or None z/proc/z!/root/var/.cagefs/.cagefs.websiteN)r � read_text�strip�PermissionErrorr �FileNotFoundError)r �website_isolation_markers r �_get_website_isolation_docrootr% ) sk � � $�$S�S�$S�$S�$S�T�T���'�1�1�3�3�9�9�;�;�;���W�&7�8� � � ��t�t����s �%; �A�A�username�filter_by_docrootsc �� � t d� |D � � � � }t � � }t j d| � d|� �� � |D ]}t j | |� � �t j g d��� � D �]L}|}|j � d� � | k r�$ |� � � }nB# t j $ r0 t j d|j � d� � � � Y �xw xY wt |j � � p|� d � � }|r||vr��|j � d� � }|�||v r��t | � � 5 t j d|� d|� �� � t |t j � � s d d d � � �� d d d � � n# 1 swxY w Y |� |� � ��Nt | � � 5 t'