PHP WebShell

Текущая директория: /usr/lib/python3/dist-packages/softwareproperties/dbus/__pycache__

Просмотр файла: SoftwarePropertiesDBus.cpython-310.pyc

o

U�7e�@�@s�ddlmZddlZddlZddlZddlZddlZddlm	Z	ddl
mZddlm
Z
dZdZdZedd	�d
d�ZGdd
�d
ej�ZGdd�dejje
�ZdS)�)�GLibN)�SourceEntry)�
DBusGMainLoop)�SoftwarePropertieszcom.ubuntu.SoftwareProperties�/T)�set_as_defaultcCstjdkr
|�d�S|S)N�3zutf-8)�sys�version�encode)�string�r
�P/usr/lib/python3/dist-packages/softwareproperties/dbus/SoftwarePropertiesDBus.py�_to_unicode(s

rc@seZdZdZdS)�PermissionDeniedByPolicyz6com.ubuntu.SoftwareProperties.PermissionDeniedByPolicyN)�__name__�
__module__�__qualname__�_dbus_error_namer
r
r
rr.srcs�eZdZdNdd�Z�fdd�Z�fdd�Zejje	d	d
�dd��Z
ejje	d	d
�d
d��Zejje	d	d
�dd��Zejje	d	d
�dd��Z
ejje	d	d
�dd��Zejje	ddd	d	d�dOdd��Zejje	ddd	d	d�dOdd��Zejje	dddd	d�dOdd��Zejje	dddd	d�dOdd ��Zejje	dddd	d�dOd!d"��Zejje	dddd	d�dOd#d$��Zejje	ddd	d	d�dOd%d&��Zejje	ddd	d	d�dOd'd(��Zejje	dddd	d�dOd)d*��Zejje	ddd+d,d�dOd-d.��Zejje	ddd	d	d�dOd/d0��Zejje	ddd	d	d�dOd1d2��Zd3d4�Zd5d6�Zejje	ddd,d	d�dOd7d8��Zejje	ddd9d	d�dOd:d;��Zejje	ddd9d	d�dOd<d=��Z ejje	ddd9d	d�dOd>d?��Z!ejje	dddd	d�dOd@dA��Z"ejje	dddd	d�dOdBdC��Z#ejje	dddd,d�dOdDdE��Z$ejje	dddd,d�dOdFdG��Z%ejje	dddd,d�dOdHdI��Z&ejje	ddd	d,d�dOdJdK��Z'dLdM�Z(�Z)S)P�SoftwarePropertiesDBusNrcCsTtj||||d�d|_d|_tjjt|d�}tjj�||t	�d|_
t�d�dS)N)�options�datadir�rootdir)�busTzwaiting for connections)
r�__init__�	dbus_info�polkit�dbus�service�BusName�DBUS_INTERFACE_NAME�Object�	DBUS_PATH�enforce_polkit�logging�debug)�selfrrrr�bus_namer
r
rr3szSoftwarePropertiesDBus.__init__c�tt|���|��dS�N)�superr�save_sourceslist�SourcesListModified�r&��	__class__r
rr+A�z'SoftwarePropertiesDBus.save_sourceslistcr(r))r*r�write_config�ConfigModifiedr-r.r
rr1Dr0z#SoftwarePropertiesDBus.write_config�)�dbus_interface�	signaturecC�t�d�dS)�0 emit signal when the sources.list got modified zSourcesListModified signalN�r$r%r-r
r
rr,I�z*SoftwarePropertiesDBus.SourcesListModifiedcCr6)r7zConfigModified signalNr8r-r
r
rr2Nr9z%SoftwarePropertiesDBus.ConfigModifiedcCr6)z, emit signal when the apt keys got modified zKeysModified signalNr8r-r
r
r�KeysModifiedSr9z#SoftwarePropertiesDBus.KeysModifiedcCr6)z6 emit signal when the policykit authentication failed zAuth signalNr8r-r
r
r�
AuthFailedXr9z!SoftwarePropertiesDBus.AuthFailedcCr6)z( emit signal when adding a cdrom failed zCdrom scan failed signalNr8r-r
r
r�CdromScanFailed]r9z&SoftwarePropertiesDBus.CdromScanFailed�sender�conn)�sender_keyword�connection_keyword�in_signature�
out_signaturecC�|�||d�|��dS�Nz*com.ubuntu.softwareproperties.applychanges)�_check_policykit_privilege�revert�r&r=r>r
r
r�Revertd��zSoftwarePropertiesDBus.RevertcCs|��dSr))�reload_sourceslistrGr
r
r�ReloadlszSoftwarePropertiesDBus.Reload�scC� |�||d�|�t|��dSrD)rE�enable_child_sourcer�r&�templater=r>r
r
r�EnableChildSources��z(SoftwarePropertiesDBus.EnableChildSourcecCrMrD)rE�disable_child_sourcerrOr
r
r�DisableChildSource{rRz)SoftwarePropertiesDBus.DisableChildSourcecCrMrD)rE�enable_componentr�r&�	componentr=r>r
r
r�EnableComponent�rRz&SoftwarePropertiesDBus.EnableComponentcCrMrD)rE�disable_componentrrVr
r
r�DisableComponent�rRz'SoftwarePropertiesDBus.DisableComponentcCrCrD)rE�enable_source_code_sourcesrGr
r
r�EnableSourceCodeSources�rIz.SoftwarePropertiesDBus.EnableSourceCodeSourcescCs"|�||d�|��|��dSrD)rE�disable_source_code_sourcesr+rGr
r
r�DisableSourceCodeSources�s
�z/SoftwarePropertiesDBus.DisableSourceCodeSourcescCrMrD)rE�toggle_source_user�r&�sourcer=r>r
r
r�ToggleSourceUse�rRz&SoftwarePropertiesDBus.ToggleSourceUse�ss�bcCs"|�||d�|�t|�t|��SrD)rE�replace_source_entryr)r&�old�newr=r>r
r
r�ReplaceSourceEntry�s��z)SoftwarePropertiesDBus.ReplaceSourceEntrycCrMrD)rE�change_main_download_serverr)r&�serverr=r>r
r
r�ChangeMainDownloadServer�rRz/SoftwarePropertiesDBus.ChangeMainDownloadServercCrCrD)rE�_add_cdrom_sourcerGr
r
r�AddCdromSource�rIz%SoftwarePropertiesDBus.AddCdromSourcec
CsJt��}dddddddddddd|jg}t�|�}t�d	|j||�d
S)z  add a (already inserted) cdrom z	apt-cdrom�addz-ozDebug::aptcdrom=1zDebug::identcdrom=1zacquire::cdrom::AutoDetect=1zacquire::cdrom::NoMount=1zDir::Etc::sourcelist=%si�N)�tempfile�NamedTemporaryFile�name�
subprocess�Popenr�timeout_add�_wait_for_cdrom_scan_finish)r&�tmp�cmd�pr
r
rrl�s
�
z(SoftwarePropertiesDBus._add_cdrom_sourcecCsl|��durdS|��}|dkr|��dSd}t|j�D]}|}q|dkr4|jj�dt|��|��dS)z= glib timeout helper to wait for the cdrom scanner to finish NTrFr3)	�pollr<�openrq�sourceslist�list�insertr�set_modified_sourceslist)r&rxrv�res�line�xr
r
rru�sz2SoftwarePropertiesDBus._wait_for_cdrom_scan_finishcC�|�||d�|�|�dSrD)rE�set_popcon_pariticipation)r&�participatesr=r>r
r
r�SetPopconPariticipation���z.SoftwarePropertiesDBus.SetPopconPariticipation�icCr�rD)rE�set_update_automation_level�r&�stater=r>r
r
r�SetUpdateAutomationLevel�r�z/SoftwarePropertiesDBus.SetUpdateAutomationLevelcCr�rD)rE�set_release_upgrades_policyr�r
r
r�SetReleaseUpgradesPolicy�r�z/SoftwarePropertiesDBus.SetReleaseUpgradesPolicycCrMrD)rE�set_update_interval�int)r&�daysr=r>r
r
r�SetUpdateIntervalrRz(SoftwarePropertiesDBus.SetUpdateIntervalcCs(|�||d�|�t|��|��dSrD)rE�add_source_from_linerr:)r&�
sourceLiner=r>r
r
r�AddSourceFromLine
s
�z(SoftwarePropertiesDBus.AddSourceFromLinecCrMrD)rE�
remove_sourcerr`r
r
r�RemoveSourcerRz#SoftwarePropertiesDBus.RemoveSourcecC�(|�||d�|�|�}|r|��|SrD)rE�add_keyr:)r&�pathr=r>rr
r
r�AddKey ��
zSoftwarePropertiesDBus.AddKeycCr�rD)rE�add_key_from_datar:)r&�keyDatar=r>rr
r
r�AddKeyFromData+r�z%SoftwarePropertiesDBus.AddKeyFromDatacCr�rD)rE�
remove_keyr:)r&�keyidr=r>rr
r
r�	RemoveKey6r�z SoftwarePropertiesDBus.RemoveKeycCs&|�||d�|��}|r|��|SrD)rE�update_keysr:)r&r=r>rr
r
r�
UpdateKeysAs�z!SoftwarePropertiesDBus.UpdateKeysc	
Cs,|dur
|dur
dS|jsdS|jdur t�|�ddd�d�|_|j�|�}|jdur9t�t���ddd�d�|_z|jjdd	tj	|d
d�if|ddit�
d
�dd
d�\}}}Wn#tjy{}z|jdkrvd|_|�
|||�WYd}~S�d}~ww|s�t�d||||t|�f�|��t|��dS)a�Verify that sender has a given PolicyKit privilege.

        sender is the sender's (private) D-BUS name, such as ":1:42"
        (sender_keyword in @dbus.service.methods). conn is
        the dbus.Connection object (connection_keyword in
        @dbus.service.methods). privilege is the PolicyKit privilege string.

        This method returns if the caller is privileged, and otherwise throws a
        PermissionDeniedByPolicy exception.
        Nzorg.freedesktop.DBusz/org/freedesktop/DBus/BusFzorg.freedesktop.PolicyKit1z%/org/freedesktop/PolicyKit1/Authorityz$org.freedesktop.PolicyKit1.Authorityzsystem-bus-namerq�)�
variant_levelr3iX)�timeoutz)org.freedesktop.DBus.Error.ServiceUnknownzW_check_polkit_privilege: sender %s on connection %s pid %i is not authorized for %s: %s)r#rr�	Interface�
get_object�GetConnectionUnixProcessIDr�	SystemBus�CheckAuthorization�String�UInt32�
DBusExceptionr�_check_polkit_privileger$r%�strr;r)	r&r=r>�	privilege�pid�is_auth�_�details�er
r
rrEMsJ

��
���
����z1SoftwarePropertiesDBus._check_policykit_privilege)NNr)NN)*rrrrr+r1rr�signalr r,r2r:r;r<�methodrHrKrQrTrXrZr\r^rbrhrkrmrlrur�r�r�r�r�r�r�r�r�r�rE�
__classcell__r
r
r.rr1s�





����������������������	r)�
gi.repositoryr�dbus.servicerr$rrror	�aptsources.sourceslistr�dbus.mainloop.glibr�%softwareproperties.SoftwarePropertiesr�
DBUS_BUS_NAMEr"r rr�rrr!rr
r
r
r�<module>s 


Выполнить команду


Для локальной разработки. Не используйте в интернете!