Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib64/python3.11/site-packages/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/__pycache__/clsetuplib.cpython-311.pyc

�

ܨfF���ddlmZddlmZddlZddlZddlZddlZddlZddlZddl	m
Z
ddlmZm
Z
Gd�d��Zee
���Zd	�Zd
�Zdd�Zd
�Zd�ZdS)�)�print_function)�absolute_importN)�remount_proc)�
SysCtlConf�SYSCTL_CL_CONF_FILEc�0�eZdZgd�ZdZdZd�Zd�Zd�ZdS)�
KernelVersion)�1r
�95�Tc�"�tjddgtjtj���}|���\}}|jdkr#td��t
jd��|�d��dkr||�	d��d�	d	��ddd��
���	d
��|_t|j��dSd|_dS)N�unamez-r)�stdout�stderrrz?error: subprocess call error. Cant't get current kernel version��lve����el�.F)
�
subprocess�Popen�PIPE�communicate�
returncode�print�sys�exit�find�split�strip�_system_kernel�
_cl_kernel)�self�p�out�errs    �py/clsetuplib.py�__init__zKernelVersion.__init__#s�����g�t�_�Z�_�Z�_�]�]�]���]�]�_�_�
��c�
�L�A����T�U�U�U��H�Q�K�K�K��H�H�U�O�O�r�!�!�"%�)�)�E�"2�"2�1�"5�";�";�D�"A�"A�!�"D�S�b�S�"I�"O�"O�"Q�"Q�"W�"W�X[�"\�"\�D���$�%�&�&�&�&�&�#�D�O�O�O�c��|jr3|j|jkr!tj�d��rdSdSt
d��tjd��dS)Nz/proc/sys/fs/symlinkown_gidTFz1error: Feature is not supported on non CL kernel.r)	r"r!�_SECURELINKS_MIN_KERNEL�os�path�isfilerrr�r#s r'�securelinks_kernel_requirementz,KernelVersion.securelinks_kernel_requirement0s[���?�	��#�t�'C�C�C�����Xu�Iv�Iv�C��t��u��E�F�F�F��H�Q�K�K�K�K�Kr)c�<�dd�|j��zS)Nrr)�joinr+r/s r'�get_securelinks_min_kernelz(KernelVersion.get_securelinks_min_kernel<s���s�x�x�� <�=�=�=�=r)N)	�__name__�
__module__�__qualname__r+r!r"r(r0r3�r)r'r	r	sU������,�n�n���N��J�
$�
$�
$����>�>�>�>�>r)r	)�config_filec�@�d}t�||��dS)zn
    Change /etc/sysctl.conf for apache gid
    :param apache_gid: id of apache's group
    :return: None
    zfs.symlinkown_gidN)�sysctl�set)�
apache_gid�symlink_commands  r'�set_securelinks_gidr>Cs#��*�O�
�J�J��
�+�+�+�+�+r)c���d}	tt�|����}n#t$rd}YnwxYw	t	j|��jn#t$rd}YnwxYw|dkrPd}tj	d|zdd���t	j
|��j}t�||��tj	d�
||��dd���d	S)
z�
    Add user to the group specified by fs.proc_super_gid.
    If fs.proc_super_gid is 0 (means undefined) or group doesn't really exists
    then create "clsupergid" group, configure it as fs.proc_super_gid and
    add user to this group
    zfs.proc_super_gidr�
clsupergidzgroupadd -f Tz	/bin/bash)�shell�
executablezusermod -a -G {} {}N)�intr:�get�
ValueError�grp�getgrgid�gr_name�KeyErrorr�run�getgrnam�gr_gidr;�format)�user�sgid_key�proc_super_gid�	sgid_names    r'�_add_to_super_gidrRNs!��#�H���V�Z�Z��1�1�2�2�����������������	��^�$�$�,�,�,������������������ �	���~�	�1��+�V�V�V�V���i�0�0�7���
�
�8�^�,�,�,��N�(�/�/���E�E��+�7�7�7�7�7�7s�',�;�;�A�A(�'A(Tc�r�tj��sdStd��|rt��dSdS)z:
    Add nagios to configured fs.proc_super_gid group
    N�nagios)�cldetectlib�
get_nagiosrRr��do_remount_procs r'�setup_nagiosrYpsI���!�#�#�����h�������������r)c��tj�d��sdS	tjd��n#t
$rYdSwxYwt
d��dS)z@
    Detect "mailman" and add it to fs.proc_super_gid group
    z"/usr/local/cpanel/3rdparty/mailmanN�mailman)r,r-�isdir�pwd�getpwnamrIrRr7r)r'�
setup_mailmanr_~sp���7�=�=�=�>�>�������Y������������������i� � � � � s�8�
A�Ac�^�td���t��t��dS)z�
    Configure "special" users to be in fs.proc_super_gid group, if it's
    necessary.
    If this GID was undefined(0) then create and setup special clsupergid group
    FrWN)rYr_rr7r)r'�setup_supergidsra�s-����'�'�'�'��O�O�O��N�N�N�N�Nr))T)�
__future__rrrrr,rFr]rU�cl_proc_hidepidr�clcommon.sysctlrrr	r:r>rRrYr_rar7r)r'�<module>res6��*&�%�%�%�%�%�&�&�&�&�&�&�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�����(�(�(�(�(�(�;�;�;�;�;�;�;�;�>�>�>�>�>�>�>�>�D
�� 3�	4�	4�	4��,�,�,�7�7�7�D����!�!�!�
�
�
�
�
r)

Hacked By AnonymousFox1.0, Coded By AnonymousFox