HEX
Server: Apache
System: Linux dinesh8189 5.15.98-grsec-sharedvalley-2.lc.el8.x86_64 #1 SMP Thu Mar 9 09:07:30 -03 2023 x86_64
User: cgmgerenciamento1 (814285)
PHP: 8.1.26
Disabled: apache_child_terminate,dl,escapeshellarg,escapeshellcmd,exec,link,mail,openlog,passthru,pcntl_alarm,pcntl_exec,pcntl_fork,pcntl_get_last_error,pcntl_getpriority,pcntl_setpriority,pcntl_signal,pcntl_signal_dispatch,pcntl_sigprocmask,pcntl_sigtimedwait,pcntl_sigwaitinfo,pcntl_strerror,pcntl_wait,pcntl_waitpid,pcntl_wexitstatus,pcntl_wifexited,pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig,pcntl_wtermsig,php_check_syntax,php_strip_whitespace,popen,proc_close,proc_open,shell_exec,symlink,system
Upload Files
File: //usr/lib/python3.6/site-packages/tracer/resources/__pycache__/system.cpython-36.pyc
3

�|
`.�@slddlmZddlZddlZddlZddlZddlZddlmZddl	m
Z
ddlmZGdd�de
�ZdS)�)�absolute_importN)�version_info)�PackageManager)�Processc@sleZdZedd��Zedd��Zedd��Zedd��Zed	d
��Zedd��Z	ed
d��Z
edd��ZdS)�SystemcCs�tjjd�r�td���}i}dddddddd	d
g	}dd�|D�}x(|D] }|jd
�\}}|jd�||<qDW|d|kr||dSd|kr�x |dj�D]}||kr�|Sq�WWdQRXntjdd�dSdS)z�
		Checks if /etc/os-release exists, and if it does, uses it to divine the name of the distribution or
		distribution like. e.g It will return 'debian' on Ubuntu systems.
		Otherwise, revert to using platform.linux_distribution()
		z/etc/os-release�gentoo�debian�rhel�centos�ol�mageia�arch�archarm�fedoracSsg|]}|j�r|j��qS�)�rstrip)�.0�linerr�/usr/lib/python3.6/system.py�
<listcomp>0sz'System.distribution.<locals>.<listcomp>�=�"ZIDZID_LIKENF)Zfull_distribution_namer)�os�path�isfile�open�split�strip�platformZlinux_distribution)Zos_release_fileZos_release_dataZdistros�linesrZos_release_keyZos_release_value�distrorrr�distribution#s

zSystem.distributioncsd�fdd�}dgdgddgdgdgdgdgdgddgd
�	}tj�}||krNdSttt|||���S)zMReturns instance of package manager according to installed linux distributioncs"|\}}tj|�}t||�f��S)N)�	importlib�
import_module�getattr)Zpairr�name�module)�kwargsrr�get_instanceBs
z,System.package_manager.<locals>.get_instance�tracer.packageManagers.portage�Portage�tracer.packageManagers.dpkg�Dpkg�tracer.packageManagers.dnf�Dnf�tracer.packageManagers.yum�Yum�tracer.packageManagers.alpm�Alpm)	rrr	r
rrr
rrN)r)r*)r+r,)r-r.)r/r0)r/r0)r/r0)r-r.)r1r2)r1r2)r-r.)r/r0)rr!r�list�map)r'r(Zmanagersr r)r'r�package_manager>s 
zSystem.package_managercCstd�}|j�jd�d}|S)zM
		Returns name of init system you are using
		e.g. init, systemd, upstart
		�� r)rr%r)Zinitr%rrr�init_system`szSystem.init_systemcCs&ytj�Stk
r tj�SXdS)N)�psutil�	boot_time�AttributeErrorZ
get_boot_timerrrrr:kszSystem.boot_timecCsdjtjtjtj�S)Nz{}.{}.{})�formatr�major�minor�microrrrr�python_versionqszSystem.python_versioncCstj�jtj�tj�d�S)N�)rr5Zfind_package�kernel_package_namer�unamerrrr�running_kernel_packageuszSystem.running_kernel_packagecCsdS)z6 TODO: infer kernel package from current distribution ZkernelrrrrrrByszSystem.kernel_package_namecCs0ytj�Stk
r*tjtj��dSXdS)Nr)r�getlogin�OSError�pwd�getpwuid�getuidrrrr�user~szSystem.userN)�__name__�
__module__�__qualname__�staticmethodr!r5r8r:r@rDrBrJrrrrr!s"r)Z
__future__rrrGr"rr9�sysrZtracer.resources.PackageManagerrZtracer.resources.processesr�objectrrrrr�<module>s