AlkantarClanX12

Your IP : 3.138.69.28


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

�

".gd���ddlZddlZddlZddlZddlZddlZddlmZddlm	Z	m
Z
Gd�d��Ze
e	���Zd�Z
d�Zd
d
�Zd�Zd�ZdS)�N)�remount_proc)�SYSCTL_CL_CONF_FILE�
SysCtlConfc�0�eZdZgd�ZdZdZd�Zd�Zd�ZdS)�
KernelVersion)�1r�95�Tc�R�tjddgtjtj���5}|���\}}|jdkr#td��t
jd��|�d��dkr{|�	d��d�	d	��ddd��
���	d
��|_t|j��nd|_ddd��dS#1swxYwYdS)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�proc�out�_s    �py/clsetuplib.py�__init__zKernelVersion.__init__&sM��
�
�
�d�O��?��?�
�
�
�
	(���%�%�'�'�F�C����!�#�#��X�Y�Y�Y��������x�x����"�$�$�&)�i�i��&6�&6�q�&9�&?�&?��&E�&E�a�&H��"��&M�&S�&S�&U�&U�&[�&[�\_�&`�&`��#��d�)�*�*�*�*�"'���
	(�
	(�
	(�
	(�
	(�
	(�
	(�
	(�
	(�
	(�
	(�
	(����
	(�
	(�
	(�
	(�
	(�
	(s�C!D�D �#D c��|jr/|j|jkotj�d��St
d��tjd��dS)Nz/proc/sys/fs/symlinkown_gidz1error: 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_requirement7sY���?�	��#�t�'C�C�B��G�N�N�#@�A�A�
�	�A�B�B�B���������c�<�dd�|j��zS)Nrr)�joinr(r,s r%�get_securelinks_min_kernelz(KernelVersion.get_securelinks_min_kernelBs���s�x�x�� <�=�=�=�=r.N)	�__name__�
__module__�__qualname__r(rr r&r-r1�r.r%rr!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<Is#��*�O�
�J�J��
�+�+�+�+�+r.c���d}	tt�|����}n#t$rd}YnwxYw	t	j|��jn#t$rd}YnwxYw|dkrQd}tj	d|��ddd���t	j
|��j}t�||��tj	d	|�d
|��ddd���dS)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/bashF)�shell�
executable�checkzusermod -a -G � N)
�intr8�get�
ValueError�grp�getgrgid�gr_name�KeyErrorr�run�getgrnam�gr_gidr9)�user�sgid_key�proc_super_gid�	sgid_names    r%�_add_to_super_gidrQTs<��#�H���V�Z�Z��1�1�2�2�����������������	��^�$�$�,�,�,������������������ �	���1�i�1�1�!�k��	H�	H�	H�	H���i�0�0�7���
�
�8�^�,�,�,��N�;�N�;�;�T�;�;��+�U�D�D�D�D�D�Ds�',�;�;�A�A(�'A(Tc�r�tj��sdStd��|rt��dSdS)z:
    Add nagios to configured fs.proc_super_gid group
    N�nagios)�cldetectlib�
get_nagiosrQr��do_remount_procs r%�setup_nagiosrXwsI���!�#�#�����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�getpwnamrIrQr5r.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
    FrVN)rXr^rr5r.r%�setup_supergidsr`�s-����'�'�'�'��O�O�O��N�N�N�N�Nr.)T)rFr)r\rrrT�cl_proc_hidepidr�clcommon.sysctlrrrr8r<rQrXr^r`r5r.r%�<module>rcs	��*�
�
�
�	�	�	�	�
�
�
�
�����
�
�
�
�����(�(�(�(�(�(�;�;�;�;�;�;�;�;�">�">�">�">�">�">�">�">�J
�� 3�	4�	4�	4��,�,�,� D� D� D�F����!�!�!�
�
�
�
�
r.