403Webshell
Server IP : 23.254.227.96  /  Your IP : 216.73.216.7
Web Server : Apache/2.4.62 (Unix) OpenSSL/1.1.1k
System : Linux hwsrv-1277026.hostwindsdns.com 4.18.0-477.13.1.el8_8.x86_64 #1 SMP Tue May 30 14:53:41 EDT 2023 x86_64
User : viralblo ( 1001)
PHP Version : 8.1.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3.6/site-packages/tuned/exports/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3.6/site-packages/tuned/exports/__pycache__/dbus_exporter.cpython-36.opt-1.pyc
3

��c'�@sddlmZddlZddlZddlZddlZddlZddlZ	ddl
jZddlZddl
Z
ddlmZddlmZddlmZddlmZddlmZdd	lmZydd
lmZdd�ZWn ek
r�dd
lmZYnXe	jj�Zdd�ZGdd�dej �Z!dS)�)�
interfaces�N)�ismethod)�polkit)�GLib)�FunctionType)�
DBusException)�ErrorMessage)�getfullargspeccCst|�S)N)r
)�func�r�#/usr/lib/python3.6/dbus_exporter.py�
getargspecsr)rcCs�t|dd�}|dk	rn0t|dd�dkr4d|jj}nd|j|jjf}t|t�rZ|j�}ndjtj	|j|��}t
|||�}|j�s�|j|�dS)NZ_dbus_error_name�
__module__��__main__zorg.freedesktop.DBus.Python.%sz!org.freedesktop.DBus.Python.%s.%s)rr)
�getattr�	__class__�__name__r�
isinstancerZget_dbus_message�join�	traceback�format_exception_onlyr	Zget_no_replyZsend_message)Z
connection�messageZ	exception�name�contentsZreplyrrr
�_method_reply_error$s

rc@s�eZdZdZdd�Zedd��Zedd��Zedd	��Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�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�tj�tjkrttj_tjjj	dd�d|_
d|_i|_t
�|_||_||_||_d|_d|_t�|_tjtj�}tj�|_tjtj|�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�_thread�_bus_objectr�_polkit�signal�	getsignal�SIGINTrZMainLoop�
_main_loop)�self�bus_name�interface_name�object_nameZsignal_handlerrrr
�__init__Bs 
zDBusExporter.__init__cCs|jS)N)r')r1rrr
r2_szDBusExporter.bus_namecCs|jS)N)r()r1rrr
r3cszDBusExporter.interface_namecCs|jS)N)r))r1rrr
r4gszDBusExporter.object_namecCs
|jdk	S)N)r*)r1rrr
�runningkszDBusExporter.runningcCsNdj|jdjt|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__r7�compile�lenr$r�	co_consts�locals)r1�method�wrapper�source�coderrrr
�_prepare_for_dbusnszDBusExporter._prepare_for_dbuscsjt��std���j}|�jkr(td����fdd�}�j�|�}tjj�j||dd�|�}|�j|<dS)Nz#Only bound methods can be exported.z*Method with this name is already exported.cs
tjd�j}|d}tjd||f��jj||�}|}|dkrXtjd||f�n�|dkrttjd||f�n�|dkr�tjd||f�t	|dd
��d	g}nZ|dkr�tjd
||f�t	|dd��d	g}n(tj
d||f�t	|dd��d	g}�||�S)N�.rz?checking authorization for action '%s' requested by caller '%s'zJaction '%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���rFrFrFrF)�constsZ	NAMESPACErr�debugr,Zcheck_authorization�warn�info�list�error)�ownerr7�kwargsZ	action_id�caller�retZ	args_copy)r?r1rr
r@�s$z$DBusExporter.export.<locals>.wrapperrO)Zsender_keyword)	r�	Exceptionrr$rCr!r"r?r()r1r?Zin_signature�
out_signature�method_namer@r)r?r1r
�export|s
zDBusExporter.exportcsnt��std���j}||jkr(td���fdd�}|j�|�}tjj|j|�|�}||j|<|j	j
|�dS)Nz#Only bound methods can be exported.z*Method with this name is already exported.cs
�||�S)Nr)rMr7rN)r?rr
r@�sz$DBusExporter.signal.<locals>.wrapper)rrQrr$rCr!r"r-r(r&�add)r1r?rRrSr@r)r?r
r-�s

zDBusExporter.signalcOsfd}||jks|jdkrd}yt|j|�}Wntk
rDd}YnX|rXtd|��n
|||�dS)NFTzSignal '%s' doesn't exist.)r&r+r�AttributeErrorrQ)r1r-r7rN�errr?rrr
�send_signal�s
zDBusExporter.send_signalcCs<|jdk	rtd��dt|�}t|tjjf|j�}||_dS)Nz%The exporter class was already build.zDBusExporter_%d)r#rQ�id�typer!r"ZObjectr$)r1Zunique_name�clsrrr
�_construct_dbus_object_class�s

z)DBusExporter._construct_dbus_object_classcCsn|j�rdS|jdkr|j�|j�tj�}tjj|j|�}|j||j	|�|_
tj|j
d�|_|jj�dS)N)�target)r6r#r\�stopr!Z	SystemBusr"ZBusNamer'r)r+�	threadingZThread�_thread_coder*�start)r1Zbusr2rrr
ra�s
zDBusExporter.startcCs2|jdk	r.|jj�r.|jj�|jj�d|_dS)N)r*Zis_aliver0�quitr)r1rrr
r^�s

zDBusExporter.stopcCs|jj�|`d|_dS)N)r0Zrunr+)r1rrr
r`�s
zDBusExporter._thread_codeN)rr�__qualname__�__doc__r5�propertyr2r3r4r6rCrTr-rXr\rar^r`rrrr
r8s"
	
r)"rrZdbus.servicer!Zdbus.mainloop.glibZdbus.exceptionsr_r-Z
tuned.logsZtunedZtuned.constsrGrr�inspectrZtuned.utils.polkitrZ
gi.repositoryr�typesrrZ
dbus.lowlevelr	r
r�ImportErrorZlogs�getrrZExporterInterfacerrrrr
�<module>s.



Youez - 2016 - github.com/yon3zu
LinuXploit