/opt/cloudlinux/venv/lib/python3.11/site-packages/xray
NameSizeModeActions
adviser/-0755rm
agent/-0755rm
analytics/-0755rm
apiclient/-0755rm
console_utils/-0755rm
continuous/-0755rm
hooks/-0755rm
internal/-0755rm
manager/-0755rm
reconfiguration/-0755rm
__pycache__/-0755rm
cl-smart-advice-user.py7280755editdlrm
cl-smart-advice.py7110755editdlrm
cloudlinux-xray-agent.py3750755editdlrm
cloudlinux-xray-continuous.py3830755editdlrm
cloudlinux-xray-manager.py3840755editdlrm
cloudlinux-xray-migrate.py15060755editdlrm
cloudlinux-xray-regenerate-ini.py20180755editdlrm
cloudlinux-xray-user-agent.py3720755editdlrm
cloudlinux-xray-user-manager.py3860755editdlrm
create_user_uid_dirs.py17600644editdlrm
imunify_manager.py88120644editdlrm
shared_library.py14280644editdlrm
smart_advice_plugin_helpers.py63710644editdlrm
smart_advice_plugin_manager.py147630755editdlrm
user_agent.py83130644editdlrm
xray_hooks.py18190644editdlrm
__init__.py6650644editdlrm
Edit: /opt/cloudlinux/venv/lib/python3.11/site-packages/xray/create_user_uid_dirs.py (1760B)
# -*- coding: utf-8 -*- # Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2025 All Rights Reserved # # Licensed under CLOUD LINUX LICENSE AGREEMENT # http://cloudlinux.com/docs/LICENSE.TXT import os from clcommon.cpapi import cpusers from clcommon.clpwd import ClPwd def create_user_uid_dirs(): """ Create /usr/share/alt-php-xray-tasks/{uid} directories for all users. The {uid} directory itself stays root-owned (0755) because it holds root-written task files the C extension reads. A {uid}/log/ subdirectory is created owned by the user (mode 0700) so the PHP worker, which runs as that uid, can write xray.to_file trace dumps there while no other local user can read or pre-create them. :return: None """ for username in cpusers(): try: uid = ClPwd().get_uid(username) base_dir = f"/usr/share/alt-php-xray-tasks/{uid}" os.makedirs(base_dir, 0o755, exist_ok=True) _create_user_log_dir(base_dir, uid) except ClPwd.NoSuchUserException: print(f"ERROR: No such user {username}") except Exception as e: print(f"Error processing user {username}: {e}") def _create_user_log_dir(base_dir, uid): """ Create base_dir/log owned by uid with mode 0700 (idempotent). makedirs' mode is masked by umask and is not applied to an already existing directory, so chmod/chown are issued explicitly to enforce the intended ownership and permissions on every run. The group is left unchanged (root) -- mode 0700 makes the group irrelevant. """ log_dir = os.path.join(base_dir, "log") os.makedirs(log_dir, 0o700, exist_ok=True) os.chown(log_dir, uid, -1) os.chmod(log_dir, 0o700)