📁 File Manager Pro
v10.0.3 | PHP: 8.2.31
Server: LiteSpeed
2026-06-28 10:36:26
📂
/ (Root)
/
opt
/
cloudlinux
/
venv
/
lib
/
python3.11
/
site-packages
/
clcommon
/
public_hooks
/
bundle
/
cpanel
/
__pycache__
📍 /opt/cloudlinux/venv/lib/python3.11/site-packages/clcommon/public_hooks/bundle/cpanel/__pycache__
🔄 Refresh
✏️
Editing: lib.cpython-311.pyc
Read Only
� D. j�F � � � d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl Z d dl mZmZm Z d dlmZ d dlmZmZmZ d dlmZ d dlmZmZmZ dZdZd Zd Zej � ed� � Z ej! e"� � Z# ej$ d� � Z%d � Z&d� Z'd"d�Z(d� Z)d� Z*d� Z+d� Z,d� Z-d� Z.d� Z/d� Z0d� Z1d� Z2d� Z3d� Z4d� Z5d� Z6d� Z7d � Z8d!� Z9dS )#� N)�POST_MODIFY_DOMAIN�PRE_MODIFY_USER�POST_MODIFY_USER)� valid_name)�run_command�ExternalProgramFailed�is_user_present)�cpapi)�makedirs_secure�write_file_secure�read_file_secure� z'Unable to find username in hook cmdlinez/usr/sbin/whmapi1z/var/lve�tmpza[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*c �R � t | � � dS # t j $ r Y dS w xY w)a Wrap the shared valid_name helper to fit the cpanel-hook return-0 convention. valid_name raises argparse.ArgumentTypeError on bad input; cpanel hooks must return 0 (not sys.exit) so the cPanel hook chain keeps running for unrelated downstream listeners.TF)r �argparse�ArgumentTypeError��values ��/builddir/build/BUILDROOT/alt-python27-cllib-3.4.40-1.el8.cloudlinux.x86_64/opt/cloudlinux/venv/lib/python3.11/site-packages/clcommon/public_hooks/bundle/cpanel/lib.py�_is_valid_usernamer 8 s? � � ��5�����t���%� � � ��u�u����s � �&�&c �z � t | t � � o&t t � | � � � � S )z�Domain-name validation matching the prior cpanel-bundle behavior but using fullmatch to defeat the trailing-newline bypass (bugbot 0bcbadf9).)� isinstance�str�bool�_VALID_DOMAIN_RE� fullmatchr s r �_is_valid_domainr D s0 � � �e�S�!�!�M�d�+;�+E�+E�e�+L�+L�&M�&M�M� Tc �V � |st dd| � d�� � dS t dd� � dS )a cPanel expects that each custom hook prints two values in the end of the execution: - status, where 1 means success - message, which explains non-1 statuses otherwise nothing really breaks, but logs are full of "script returned invalid response" msgs :param hook_name: name, path or anything else to fill message with in order to understand what exactly failed :param success: is it everything ended successfully? :return: Nothing r zFailed to execute hook zy; you can find logs in /var/log/cloudlinux/hooks/info.log and contact CloudLinux Support if you need help with the issue.r �OkN)�print)� hook_name�successs r �print_responser$ J sS � � � � �a� (�9� (� (� (� )� )� )� )� )� �a������r c � � t j ddgt j t j d�� � 5 } | � � � \ }}| j dk r"t � d| j ||� � ddd� � dS # 1 swxY w Y dS )z^ Run lvectl sync-map and log possible stdout|err in case of errors. :return: None �lvectlzsync-mapT)�stdout�stderr�textr z�Error during "lvectl sync-map", code: %s, stderr: `%s`, stdout: `%s`. Reseller limits kernel mapping might be not synchronized.Contact CloudLinux Support for help.N)� subprocess�Popen�PIPE�communicate� returncode�logger�error)�procr'