HEX
Server: Apache
System: Linux insrv.serversdaddy.com 5.14.0-362.24.2.el9_3.x86_64 #1 SMP PREEMPT_DYNAMIC Sat Mar 30 14:11:54 EDT 2024 x86_64
User: jsaha (1066)
PHP: 8.3.6
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib/python3.9/site-packages/sos/report/plugins/__pycache__/sos_extras.cpython-39.pyc
a

^��c��@s6ddlmZmZddlZddlZGdd�dee�ZdS)�)�Plugin�IndependentPluginNc@s&eZdZdZdZdZefZdd�ZdS)�	SosExtrasz/Collect extra data defined in /etc/sos/extras.dZ
sos_extrasz/etc/sos/extras.d/c
Cs�zHt�|j�}|jdks0|jtj@s0|jtj@rF|�d|j�WdSWn$tyl|�d|j�YdS0t�	|j�D�]\}}}|D�]}|�
||�}|�d|�z�t|����
�D]�}t|���dks�|�d�r�q�|�d��rV|��}d}	t|�dk�r:zt|d�}	Wn&t�y8|�d||f�Yn0|j|ddd�|	d	�q�|j||d
�q�Wq�t�y�|�d|�Yq�0q�qzdS)Nrz@Skipping sos extras as %s has too wide permissions or ownership.z"can't stat %s, skipping sos extrasz#Collecting data from extras file %s�#�:�zFCan't decode integer sizelimit on line '%s' in file %s, using default.)Z	sizelimit)Zsubdirzunable to read extras file %s)�os�stat�
extras_dir�st_uid�st_mode�S_IWGRP�S_IWOTHZ	_log_warn�OSError�walkZ	path_join�open�read�
splitlines�len�split�
startswith�int�
ValueErrorZ
add_copy_specZadd_cmd_output�IOError)
�self�st�path�dirlistZfilelist�fZ_file�line�words�limit�r"�A/usr/lib/python3.9/site-packages/sos/report/plugins/sos_extras.py�setup.sH
��
�
�zSosExtras.setupN)�__name__�
__module__�__qualname__Z
short_descZplugin_namer
�filesr$r"r"r"r#rs
r)Zsos.report.pluginsrrrr	rr"r"r"r#�<module>	s