Mini Shell
�
?��p�� � � d dl mZ d dl mZ d dl mZ d dl mZ d dlmZ d dlmZm Z m
Z
ej � � d dlT d dl
mZ d d lZd d lZd d lZd d lZd d lZd d lZd d lZd d lZd d lZd d lZd d lZd d lZd d lZd d lZd d lZd d lZd d lZd d l Z d d l!Z!d d l"Z"d d l#Z#d d l$Z$d d l%Z%d d l&Z&d d
l'm(Z( d dl)m*Z* d dl+m,Z,m-Z- d d
l.m/Z/m0Z0 d dl1m2Z2 d dl3m4Z4m5Z5m6Z6m7Z7 d dl8m9Z9 d dl:m;Z;m<Z< d dl=m>Z>m?Z?m@Z@mAZAmBZB d dlCmDZD d dlEmFZFmGZGmHZHmIZI d dlJmKZKmLZL d dlMmNZNmOZOmPZPmQZQmRZRmSZS d dlTmUZU d d lVZVd d lWZWd d lXZXd d lYZYd d lZZZdZ[ eS� � rdZ[dZ\dZ]dZ^dZ_da`dZad Zbd!Zcd"Zdd#Zeecd$z Zfedd%z Zgd&Zhd'Zid(Zjd)Zkd*Zld+Zmd,Znd-Zod.Zpd/Zqd0ard1Zsd2Ztd3Zud4Zvd5Zwd6Zxd7Zyd8Zzd9Z{d:Z|d;Z}d<Z~d=Zd>Z�d?Z�d@Z�dAZ�ecdBz Z�ecdCz Z�dDZ�dEZ� ej� � � j� Z� G dF� dGe*� � Z�dH ej� � � j� �� � � v re�j� j� e�j� j� z Z�ne�j� j� e�j� j� z Z�dIZ�ej� �� eb� � d d lMZMd d l�Z�d dJl�m�Z� eieM_i ejeM_j t� eM_` dKdLgZ��d\dM�Z�dN� Z��d]dO�Z�dP� Z�dQ� Z�dR� Z�dS� Z�dT� Z�dU� Z�dVZ�d a�d a�dW� Z�dXdYdZd[d\d]d^d_d`dadbdcexdddedfdge��� dh� � e��� di� � gZ�dXZ�djZ�dkZ�g dl�Z�dmgZ�dndogZ�dp� Z�dq� Z�dr� Z��d^dt�Z�t� fdu�Z�dv� Z�dw� Z�dx� Z�dyZ�dz� Z��d_d{�Z�d|� Z�d}� Z�d~� Z�d� Z�d�� Z�d�� Z��d^d��Z�d�� Z��d`d��Z�i a�epfd��Z�d�� ZŐd\d��Z�d�� Zǐdad��Z�d�� Z�d�� Zʐd^d��Z�d�� Z�d�� Z͐d\d��Z�d�� Z�d�� Z�d�� Z�d�ej� ej� z fd��Z�d�� Z�d�� Z�d�� Z�d�Z�d a�d�� Z�d�� Zېd^d��Z�d�� Zݐd^d��Z�d�� Z�d�e
e� fd��Z�d�� Z�d�� Z�d�� Z�d�� Z�d�� Z�d�� Z�d�� Z�d�� Z�d�� Z�d�� Z�d�� Z�d\d��Z�d�� Z�d�� Z�d�� Z�d�� Z�dbd��Z�d�� Z�d�� Z�d�� Z��dcd��Z�ehfd��Z�d�� Z�d�ej� fd��Z�d�� Z�d�� Z�ehdsdsfd��Z��ddd��Z�d Z� G dÄ d�e*� � �Z G dń dƦ � �ZdDŽ �ZdȄ �ZdɄ �Zdʄ �Zd�d�d�eM�j d�d�d�g�Zdф �Z�ddd҄�Z dӐe
d�d fdԄ�Z�d^dՄ�Zdք �Z
G dׄ dؐe� � �Zdل �Zdڄ �Z�dedۄ�Zd eM�j fd܄�Z�d\d݄�Z�d\dބ�Zd߄ �Zd� �Zd� �Zd� �Zd� �Zd� �Zd� �Zg �ai �ad� �Z �d\d��Z!d� �Z"�d^d��Z#d� �Z$d� �Z%d� �Z&d� �Z'�d^d��Z(d� �Z)�d_d��Z*�d^d��Z+d� �Z,d� �Z-d� �Z.�d^d���Z/d�� �Z0d�� �Z1�d^d���Z2d�� �Z3d�� �Z4d�� �Z5�d^d���Z6d�� �Z7d�� �Z8ds�a9d�� �Z:�d � �Z;�d� �Z<�d� �Z=�d� �Z>�d� �Z?�d^�d��Z@�d^�d��ZA�d^�d��ZB�d^�d��ZC�d � �ZD�d
� �ZE�d� �ZF�d� �ZG�d
� �ZH�d� �ZI�d� �ZJ�d� �ZK�d� �ZL�d� �ZM�d� �ZNd �aO�df�d��ZP�d� �ZQi �aR�d�deM�jS z �dz �deM�jT z �dz �deM�jS z �dz g�aU�d� �ZV�d\�d��ZW�d� �ZX�dg�d��ZY�d\�d��ZZ�dh�d��Z[�d� �Z\�di�d��Z]�d � �Z^�d_�d!��Z_�d"�Z`�d#� �Za�d$� �Zb�d%� �Zc �dj�d&��Zd�d\�d'��Ze�d\�d(��Zf�d\�d)��Zg�d*� �Zh�d+� �Zi�d,� �Zj�d-� �Zk�d.� �Zl�d/� �Zm�d0� �Zn�d1� �Zo�d2� �Zp�dk�d3��Zq�d\�d4��Zr�di�d5��Zs�d6� �Zt�d7� �Zui �av�d8� �Zw�d9� �Zx�d:� �Zy�d;� �Zz�d<� �Z{�d=� �Z|�d\�d>��Z}�d?� �Z~�d@� �Z�dA� �Z��dB� �Z��dC� �Z��dD� �Z��dE� �Z��dF� �Z��dG�e��dHe
e� d�d f�dI��Z��dG�e�d�d f�dJ��Z��dKe
�e� d�d f�dL��Z��dM� �Z��dN� �Z��dO� �Z��dP� �Z��dQ� �Z� �e�� � �dRe
�e� d�e
�e� f�dS��Z��dT� �Z��dU� �Z��d_d�e e
�e� �dV�e
d��e
f�dW��Z��d\d�e e
�e� d��e
f�dX��Z�d�e�f�dY��Z��dZ� �Z��e��d[k r
�e�� � d S d S (l � )�print_function)�absolute_import)�division)�unicode_literals)�standard_library)�Dict�Optional�List)�*)�
native_strN)�defaultdict)�Enum)�BASEDIR�SYMLINKS)�get_linksafe_gid�get_user_prefix)� read_file)�configure_alt_php�is_ea4_enabled�read_cpanel_ea4_php_conf�switch_symlink)�
get_alt_paths)�is_plesk� is_cpanel)�ExternalProgramFailed�create_symlink�is_socket_file�is_may_detach_mounts_enabled�mod_makedirs)�ProcLve)�ClPwd�reload_processes�
clconfpars� clcaptain)�
unicodeify�byteify)�
stripslash�CageFSException�SYSTEMD_JOURNAL_SOCKET�is_new_syslog_socket_used�relative_symlink�is_running_without_lve)�loggerz/usr/sbin/lvectlz /bin/truez/bin/umountz
/bin/mountz/bin/lve_umountz/var/cagefs.uid�/usr/share/cagefs-skeletonz/cagefs-skeleton/z/usr/share/cagefsz/etc/cagefs/z/usr/share/cagefs/z/etc/cagefs/conf.d/z cagefs.mpzcagefs.mp.prevz/usr/share/cagefs/.lockz/etc/cagefs/etc.safe/etc.systemz/etc/cagefs/etc.safe/etc.safe�/etc/cagefs/etc.safez%/usr/share/cagefs/skeleton.files.listz$/usr/share/cagefs/skeleton.libs.listz/usr/share/cagefs/passwd.cachez/usr/share/cagefs/conf.dz/etc/cagefs/excludez/usr/share/cagefs/excludei� z/etc/cagefs/cagefs.min.uidz/var/lock/subsys/cagefsz"/etc/cagefs/etc.safe/disable.etcfsz
/usr/bin/diffz/var/run/proxyexec/cagefs.sockz/var/lib/proxyexec/cagefs.sockz/etc/cagefs/black.listz2/usr/share/cagefs-plugins/install-cagefs-plugin.pyz/usr/share/cagefs/.cagefs.emptyz"/usr/share/cagefs/exclude.packagesz/etc/cagefs/proxy.commandsz/usr/share/cagefs/need.remountz/var/log/cagefs.logz/var/lve/lveinfo.verz/usr/share/l.v.e-manager/cl.{}z/etc/cagefs/dev.shm.optionsz/etc/cagefs/enabled_debug�users.disabled�
users.enabled�InitializedzNot initializedc � � e Zd ZdZg d�Zg d�d�d�d�d�d�d �d
�de� ��d�d
�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d �d!�d"�d#�d$�d%�d&�d�d'�d(�d)�d*�d+�d,�d-�d.�d/�d0�d1�d2�d3�d4�d5�d6�d7�d8�d9�d:�Zg d;�Zd<S )=�DefaultPackagesz'Default packages, used in cagefs --init)�tcl�cpp�gcc�automake�autoconf�m4�mc�ghostscript�
fontconfig�aspellz aspell-en�hunspell� coreutilszpython3-virtualenv�libxml2�recodezcrypto-policies� snmptrapd�unixodbc�opensslz
alt-libicu�enchant�curlz
cpanel-git�git�imagemagickzlibmagick++-dev�
perlmagick�expatz
libexpat1-dev�libltdl7�libnss3zbuild-essentialzlinux-headers-�gfortranzlib32gcc-10-devzg++zlibtext-pdf-perl�libedit2zhunspell-en-uszlibcogl-pango-devz python3.8zlibc-client2007e�libodbc1� libmhash2�
libmcrypt4z
libxslt1.1�libtidy5deb1�libicu66z
libicu-dev� tmpreaperz
libgpg-error0�
postgresqlzpostgresql-contribz
libpng-devzlibgmp3-devzlibpam-modules�bzip2zlibpam-cracklib�ncdu�libidn11z
db5.3-util�libncurses6�slapd�libxpm4�libgcrypt20z
libsasl2-2�zlib1g�snmpd�snmpzlibsnmp-devz libmm-dev�libfreetype6zlibfreetype6-devz libssh2-1zgeoip-database�ffmpeg�dnsutils�libgs9z libgs-devz
libgs9-common)N�ImageMagickzImageMagick-c++zImageMagick-c++-develzImageMagick-develzImageMagick-perlzcloudlinux-ImageMagickzcloudlinux-ImageMagick-c++z cloudlinux-ImageMagick-c++-develzcloudlinux-ImageMagick-develrK zexpat-develzlibtool-ltdl�nssznss-softoknzcompat-glibc-headersz
glibc-headerszkernel-headerszcompat-libgcc-296zgcc-gfortranzcompat-gcc-34-c++zcompat-gcc-34-g77�libgcczgcc-c++z
compat-gcc-34zredhat-rpm-configzfontpackages-filesystemz
perl-Text-PDFz pdf-toolszperl-PDF-Reuse�libeditzhunspell-enzgit-core�pango�mktempz scl-utils�python36zlibc-client-2007ez
unixODBC-libs�mhash�tcp_wrapperszcompat-libstdc++� libmcrypt�libxslt�libtidy�libicuzlibicu-devel�tmpwatchznet-snmpzlibgpg-errorzpostgresql-libs�libpng�gmp�pamz
bzip2-libs�cracklib�ncurses�libidnzlibc-client-2004g�db4zncurses-libs�openldap�libXpm� libgcryptzcyrus-sasl-lib�zlibz
net-snmp-libs�libmm�freetypezfreetype-develz
curl-devel�libssh2�GeoIPz
cyrus-saslzffmpeg-libs�termcapz
bind-utils�libgszlibgs-develN)�__name__�
__module__�__qualname__�__doc__�common_packages�
kernel_header�ubuntu�centos� � �]/builddir/build/BUILDROOT/cagefs-7.6.19-1.el9.cloudlinux.x86_64/usr/share/cagefs/cagefsctl.pyr4 r4 � s� � � � � � �1�1�� � �O�8:��:��:� �:� � :�
�:� �
:� �:� �:� )��(�(�:� �:� �:� �:� �:� �:� �:� �!:�"