XylotrechusZ
�
E�\hZ � �z � d Z ddlZddlZddlZddlZddlmZmZ ddlmZ ddl m
Z
ddlmZm
Z
ddlmZmZ ddlmZ dd lmZ dd
lmZ ddlmZ ddlmZ d
ZdZ ej e � � Z!de"de"de#fd�Z$ ed�� � de%fd�� � Z&d� Z'de"de#de#fd�Z(de"de"de
e" fd�Z)de"de#fd�Z*de"de+fd�Z,d� Z-dS )u
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License,
or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Copyright © 2019 Cloud Linux Software Inc.
This software is also available under ImunifyAV commercial license,
see <https://www.imunify360.com/legal/eula>
� N)�datetime� timedelta)� lru_cache)�Optional)�get_domains_php_info�get_installed_php_versions)�MalwareScanSchedule�MalwareScanScheduleInterval)�
MalwareHit)�QueueSupervisorSync)� user_list)�WP_CLI_WRAPPER_PATH)�PHPErrorz/usr/sbin/cagefs_enter_userz/usr/sbin/cagefsctl�php_path�docroot�returnc �0 � t t � � | |gS )zGet wp cli common command list)�strr )r r s �I/opt/imunify360/venv/lib/python3.11/site-packages/imav/wordpress/utils.py�
wp_wrapperr 9 s � ��#�$�$�h��8�8� � )�maxsizec � � t j � t � � r$t j t t j � � st
� � S t j t dgdd�� � } | j dk rt
� � S | j
� � � � d� � }t
|dd� � � S )z)Get the list of users enabled for CageFS.z--list-enabledT)�capture_output�textr �
r N)
�os�path�isfile�CAGEFS_CTL_PATH�access�X_OK�set�
subprocess�run�
returncode�stdout�strip�split)�result�liness r �get_cagefs_enabled_usersr- >