%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/self/root/opt/alt/python37/lib/python3.7/site-packages/__pycache__/
Upload File :
Create Path :
Current File : //proc/self/root/opt/alt/python37/lib/python3.7/site-packages/__pycache__/clsetuplib.cpython-37.pyc

B

L#LbF�@s�ddlmZddlmZddlZddlZddlZddlZddlZddlZddl	m
Z
ddlmZm
Z
Gdd�d�Zee
d�Zd	d
�Zdd�Zddd�Zdd�Zdd�ZdS)�)�print_function)�absolute_importN)�remount_proc)�
SysCtlConf�SYSCTL_CL_CONF_FILEc@s6eZdZdddgZdZdZdd�Zdd�Zd	d
�ZdS)�
KernelVersion�1Z95�TcCs�tjddgtjtjd�}|��\}}|jdkr@td�t�d�|�d�dkr�|�	d�d�	d	�ddd��
��	d
�|_t|j�nd|_dS)N�unamez-r)�stdout�stderrrz?error: subprocess call error. Cant't get current kernel version��lve���Zel�.F)
�
subprocess�Popen�PIPEZcommunicate�
returncode�print�sys�exit�find�split�strip�_system_kernel�
_cl_kernel)�self�p�out�err�r!�;/opt/alt/python37/lib/python3.7/site-packages/clsetuplib.py�__init__#s

,zKernelVersion.__init__cCs>|jr(|j|jkr"tj�d�r"dSdSntd�t�d�dS)Nz/proc/sys/fs/symlinkown_gidTFz1error: Feature is not supported on non CL kernel.r
)	rr�_SECURELINKS_MIN_KERNEL�os�path�isfilerrr)rr!r!r"�securelinks_kernel_requirement0sz,KernelVersion.securelinks_kernel_requirementcCsdd�|j�S)Nrr)�joinr$)rr!r!r"�get_securelinks_min_kernel<sz(KernelVersion.get_securelinks_min_kernelN)	�__name__�
__module__�__qualname__r$rrr#r(r*r!r!r!r"rs

r)Zconfig_filecCsd}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)Z
apache_gidZsymlink_commandr!r!r"�set_securelinks_gidCsr0cCs�d}ytt�|��}Wntk
r.d}YnXyt�|�jWntk
rXd}YnX|dkr�d}tj	d|ddd�t�
|�j}t�||�tj	d�
||�ddd�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_gidrZ
clsupergidzgroupadd -f Tz	/bin/bash)�shell�
executablezusermod -a -G {} {}N)�intr.�get�
ValueError�grpZgetgrgidZgr_name�KeyErrorr�runZgetgrnamZgr_gidr/�format)�userZsgid_keyZproc_super_gidZ	sgid_namer!r!r"�_add_to_super_gidNs 

r;TcCs"t��sdStd�|rt�dS)z:
    Add nagios to configured fs.proc_super_gid group
    NZnagios)�cldetectlibZ
get_nagiosr;r)�do_remount_procr!r!r"�setup_nagiosps
r>cCs@tj�d�sdSyt�d�Wntk
r2dSXtd�dS)z@
    Detect "mailman" and add it to fs.proc_super_gid group
    z"/usr/local/cpanel/3rdparty/mailmanNZmailman)r%r&�isdir�pwd�getpwnamr7r;r!r!r!r"�
setup_mailman~srBcCstdd�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
    F)r=N)r>rBrr!r!r!r"�setup_supergids�s
rC)T)Z
__future__rrrrr%r6r@r<Zcl_proc_hidepidrZclcommon.sysctlrrrr.r0r;r>rBrCr!r!r!r"�<module>s("
"


Zerion Mini Shell 1.0