Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/clwizard/modules/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/clwizard/modules/__pycache__/cagefs.cpython-311.pyc

�

���f����ddlZddlmZddlmZddlmZddlmZm	Z	ddl
mZddlm
Z
dd	lmZGd
�de��ZdS)�N)�Feature)�ExternalProgramFailed)�check_cagefs_initialized)�CageFs�CageFsException)�MODULES_LOGS_DIR)�InstallationFailedException�)�WizardInstallerc���eZdZej�ed��Zej	Z
�fd�Zd�Zd�Z
d�Zd�Zd�Zd�Zed	���Zd
�Z�xZS)�CagefsInstallerz
cagefs.logc�|��t�����t|j���|_dS)N)�logger)�super�__init__r�
app_logger�cgfs)�self�	__class__s ��N/opt/cloudlinux/venv/lib64/python3.11/site-packages/clwizard/modules/cagefs.pyrzCagefsInstaller.__init__s1���
���������$�/�2�2�2��	�	�	�c���|j���}|j���}|j�d|��|dkr|j���dSdS)z`
        Enable all users statuses and after it toggle to initial mode
        :return:
        z.Cagefs users status was updated to enabled: %s�Disable AllN)r�
get_user_mode�set_enabled_moder�info�toggle_user_mode)r�initial_mode�outs   r�_enable_existing_usersz&CagefsInstaller._enable_existing_userssp��
�y�.�.�0�0���i�(�(�*�*������M�s�S�S�S��=�(�(��I�&�&�(�(�(�(�(�)�(rc��|j���}|j�d|��|dkrO|j�d��|j���|j�d��dSdS)NzCurrent mode is: %srzTry to set mode to Enable allzMode was toggled to Enable all)rrrrr)r�modes  r�_set_enabled_modez!CagefsInstaller._set_enabled_mode's����y�&�&�(�(������2�D�9�9�9��=� � ��O� � �!@�A�A�A��I�&�&�(�(�(��O� � �!A�B�B�B�B�B�!� rc���|�d��s9	|�d��dS#t$r}t��|�d}~wwxYw|j�d��dS)N�cagefsz2Skip package installation, it is already installed)�_is_package_installed�_install_packagerr	rr)r�errs  r�_install_cagefs_packagez'CagefsInstaller._install_cagefs_package/s����)�)�(�3�3�	W�
=��%�%�h�/�/�/�/�/��(�
=�
=�
=�1�3�3��<�����
=����
�O� � �!U�V�V�V�V�Vs�.�
A�A�Ac�V�t��s�	|j���}|j�d|��dS#t
$r<}|j�dt|����t��|�d}~wwxYw|j�d��dS)NzCagefs was initialized: %sz+Cagefs initialization failed with error: %sz8Initializing was skipped, cagefs was already initialized)	rr�initialize_cagefsrrr�error�strr	�rrr(s   r�_initialize_cagefsz"CagefsInstaller._initialize_cagefs8s���'�)�)�	]�
=��i�1�1�3�3����$�$�%A�3�G�G�G�G�G��"�
=�
=�
=���%�%�&S�UX�Y\�U]�U]�^�^�^�1�3�3��<�����
=����
�O� � �![�\�\�\�\�\s�4A�
B�7B�Bc��	|j���}|j�d|��dS#t$r}t��|�d}~wwxYw)Nz/Cagefs was enabled, ready for configuration
 %s)r�
enable_cagefsrrrr	r.s   r�_enable_cagefszCagefsInstaller._enable_cagefsCsg��	9��)�)�)�+�+�C��O� � �!S�UX�Y�Y�Y�Y�Y���	9�	9�	9�-�/�/�S�8�����	9���s�48�
A�A�Ac��|���|���|���	|dr|���|dr|���dSdS#t
$r<}|j�dt|����t��|�d}~wwxYw)N�enable_for_existing_users�enable_for_new_userszCan`t configure options: %s)
r)r/r2r r#rrr,r-r	)r�optionsr(s   r�run_installationz CagefsInstaller.run_installationJs����$�$�&�&�&����!�!�!�������	9��2�3�
.��+�+�-�-�-��-�.�
)��&�&�(�(�(�(�(�
)�
)���	9�	9�	9��O�!�!�"?��S���J�J�J�-�/�/�S�8�����	9���s�8A:�:
C�7B;�;Cc�
�ddhS)Nr4r5�)�clss r�supported_optionsz!CagefsInstaller.supported_optionsWs��+�-C�D�Drc���	|j���dk}n,#t$r|j�d��d}YnwxYwtt
����d|id�S)Nz
Enable Allz?Unable to detect cagefs mode, assuming that it is "Disable All"Fr5)�already_configuredr6)rrrr�warning�boolr)r�enabled_for_news  r�initial_statuszCagefsInstaller.initial_status[s���	$�"�i�5�5�7�7�<�G�O�O���	$�	$�	$��O�#�#�Q�
�
�
�$�O�O�O�		$����#'�'?�'A�'A�"B�"B�.��@�
�
�	
s� �&A	�A	)�__name__�
__module__�__qualname__�os�path�joinr�LOG_FILEr�CAGEFS�_REQUIRED_CL_COMPONENT_SUPPORTrr r#r)r/r2r7�classmethodr;rA�
__classcell__)rs@rr
r
s���������w�|�|�,�l�;�;�H�%,�^�"�3�3�3�3�3�	)�	)�	)�C�C�C�W�W�W�	]�	]�	]�9�9�9�9�9�9��E�E��[�E�
�
�
�
�
�
�
rr
)rE�clcommon.constr�clcommon.utilsr�!clconfig.cagefs_statistics_configr�cllimits.cagefs_librr�clwizard.constantsr�clwizard.exceptionsr	�baserr
r9rr�<module>rTs���
�	�	�	�"�"�"�"�"�"�0�0�0�0�0�0�F�F�F�F�F�F�7�7�7�7�7�7�7�7�/�/�/�/�/�/�;�;�;�;�;�;�!�!�!�!�!�!�V
�V
�V
�V
�V
�o�V
�V
�V
�V
�V
r

Hacked By AnonymousFox1.0, Coded By AnonymousFox