https://t.me/AnonymousX5
Server : Apache
System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64
User : njnconst ( 1116)
PHP Version : 8.4.18
Disable Function : NONE
Directory :  /opt/alt/python37/lib/python3.7/site-packages/lvemanager/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //opt/alt/python37/lib/python3.7/site-packages/lvemanager/__pycache__/sudoers.cpython-37.pyc
B

���b��@s�ddlmZddlmZddlmZddlZddlZddlmZddlm	Z	m
Z
ddlmZm
Z
ddlmZdd	lmZd
ZdZdZd
d�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�ZdS)�)�print_function)�division)�absolute_importN)�remount_proc)�admins�	getCPName)�
SysCtlConf�SYSCTL_CL_CONF_FILE)�is_cl_solo_edition)�Clsudo�admin�
clsupergidZ	clsudoerscCs"t�dd||g�}|dkrdSdS)zAdd user to given unix groupz/usr/bin/gpasswdz-arFT)�
subprocess�call)�	user_name�
group_name�retcode�r�C/opt/alt/python37/lib/python3.7/site-packages/lvemanager/sudoers.py�_add_user_to_groupsrcCs"t�dd||g�}|dkrdSdS)Nz/usr/bin/gpasswdz-drFT)rr)rrrrrr�_remove_user_from_group'srcCs8tt��}||kr|�|�x|D]}t||�q"WdS)z�
    Add all present DA admins (plus new_admin_name admin) to supplied group
    :param new_admin_name: new admin name to add
    :return:
    N)�listr�appendr)r�new_admin_nameZ
admin_listrrrr�_add_admins_into_group.s



rcCs t�dd|g�}|dkrdSdS)zCreate group with given namez/usr/sbin/groupaddz-frFT)rr)rrrrr�
_create_group<srcCs�tt�t�j�}ttd�}|�d�}|�d�sH|�	d|�t
t|�dSt�dkr�ytt�t�j�}Wnt
k
r~d}YnX||kr�|�	d|�t
t|�dSyt|�}Wntk
r�td��YnXt�|�j}t
||�dS)z�
    Add all present DA admins (plus new_admin_name admin) to current supergid group
    :param new_admin_name: new admin name to add
    :return:
    )�config_filezfs.proc_super_gidN�DirectAdminz6Bad fs.proc_super_gid option value in /etc/sysctl.conf)�str�grp�getgrnam�SUPER_GROUP_NAME�gr_gidrr	�getZ
has_parameter�setrr�DEFAULT_GROUP_NAME�KeyError�int�
ValueError�RuntimeError�getgrgid�gr_name)rZ	super_gidZ
sysctl_cfgZproc_super_gidZ	admin_gidZproc_super_namerrr�_add_admins_into_supergid_grpDs,






r,cCs�t�s<tt�stdt��t|�t|t�s<td|tf��tt�sPtdt��t|t�sjtd|tf��t�}|�t�t	�dS)NzERROR: Can't create %s group
z%ERROR: Can't add user %s to %s group
)
r
rr!�	Exceptionr,r�SUDOERS_GROUP_NAMErZadd_lvemanager_groupr)�nameZsudorrr�add_unix_user_to_sudoersks


r0cCst|t�t|t�dS)N)rr!r.)r/rrr�remove_unix_user_from_sudoers�s
r1)�
__future__rrrrrZcl_proc_hidepidrZclcommon.cpapirrZclcommon.sysctlrr	�clcommon.lib.cleditionr
Zclsudorr%r!r.rrrrr,r0r1rrrr�<module>s&	'

https://t.me/AnonymousX5 - 2025