🔐 Sid Gifari File Manager Pro
v8.0.5 | 2026-08-09 08:29:15 | PHP 8.2.33
📂
/ (Root)
/
opt
/
cloudlinux
/
venv
/
lib
/
python3.11
/
site-packages
/
clwpos
/
__pycache__
📍 /opt/cloudlinux/venv/lib/python3.11/site-packages/clwpos/__pycache__
🔄 Refresh
✏️
Editing: wp_config.cpython-311.pyc
Read Only
� C!Mj4 � �~ � d Z ddlmZmZ ddlZddlZddlZddlmZ ddl m Z dZdZde d efd �Zde d e e fd�ZdS )z"Module for work with wp_config.php� )�absolute_import�print_functionN)�Path)�Listz wp-config.phpi �abs_wp_path�returnc �, � t | t � � S )z, Return path to wp-config.php file. )r �WP_CONFIG_SUFFIX)r s �G/opt/cloudlinux/venv/lib64/python3.11/site-packages/clwpos/wp_config.py�pathr s � � ��-�.�.�.� c � � t j t | � � t j t j z t j z � � } t j |� � }t j |j � � s t dt | � � � d�� � �|j t k r(t dt | � � � dt � d�� � �t dz }g }|}|dk rEt j ||� � }|sn-|� |� � |t |� � z }|dk �Et j |� � n# t j |� � w xY wd� |� � }t |� � t k r(t dt | � � � dt � d�� � �t% j t% j |� � d� � � 5 }|� � � cd d d � � S # 1 swxY w Y d S )a- Read wp-config.php located in specified WP path. The file is tenant-owned, so open it with O_NOFOLLOW (reject a symlinked final component) and O_NONBLOCK (open() cannot block on a FIFO with no writer), fstat the opened fd to require a regular file (reject FIFO/device/socket/dir), and bound the actual read to MAX_WP_CONFIG_BYTES. The fstat st_size is only a fast-reject of an already-oversized file; it does not bound the read, because a tenant can grow (append to) the file after the fstat but before/while the bytes are consumed, so the read itself must be hard-capped: pull at most MAX_WP_CONFIG_BYTES + 1 bytes and reject if the file yielded more than the cap (a grown/sparse file), rather than returning a truncated config that would corrupt the file on write-back. The bytes are then split into lines exactly as the previous open(errors='surrogateescape').readlines() did (universal-newline text decode), so a small regular config returns the identical list of lines. Because the type check is on the actually-opened fd it also closes the stat-vs-open TOCTOU window. A symlinked path or a non-regular/oversized file raises OSError, matching the missing/unreadable semantics of the previous bare open() so callers' error handling is intact. zwp-config.php at z is not a regular filez exceeds z bytes� r r �surrogateescape)�errorsN)�os�openr �O_RDONLY� O_NOFOLLOW� O_NONBLOCK�fstat�stat�S_ISREG�st_mode�OSError�st_size�MAX_WP_CONFIG_BYTES�read�append�len�close�join�io� TextIOWrapper�BytesIO� readlines) r �fd�st�limit�chunks� remaining�chunk�raw�fs r r r s � �, ���k�"�"�B�K�"�-�$?�"�-�$O� P� P�B�� �X�b�\�\���|�B�J�'�'� Y��W�d�;�.?�.?�W�W�W�X�X�X� �:�+�+�+��e�d�;�.?�.?�e�e�J]�e�e�e�f�f�f� $�a�'����� ��!�m�m��G�B� �*�*�E�� ���M�M�%� � � ���U���#�I� �!�m�m� ������������������ �(�(�6� � �C� �3�x�x�%�%�%��a�$�{�*;�*;�a�a�FY�a�a�a�b�b�b� � �"�*�S�/�/�2C� D� D� D� ���{�{�}�}�� � � � � � � � � � � ���� � � � � � s �CD; �;E�G2�2G6�9G6)�__doc__� __future__r r r# r r �pathlibr �typingr r r �strr r � r r �<module>r5 s� �� )� (� 6� 6� 6� 6� 6� 6� 6� 6� � � � � � � � � ���� � � � � � � � � � � � �"� � "� �/�c� /�d� /� /� /� /�2�c� 2�d�3�i� 2� 2� 2� 2� 2� 2r
💾 Save Changes
❌ Cancel