HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: xnsbb3110 (1041)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/firewall/server/__pycache__/config_zone.cpython-310.pyc
o

bhAb���@s�ddlZddlZddlmZddlmZmZmZddlm	Z	ddl
mZddlm
Z
ddlmZddlmZdd	lmZdd
lmZmZmZmZddlmZddlmZdd
lmZmZmZm Z Gdd�de�Z!dS)�N)�config)�dbus_to_python�%dbus_introspection_prepare_properties�!dbus_introspection_add_properties)�Zone)�ifcfg_set_zone_of_interface)�DEFAULT_ZONE_TARGET)�	Rich_Rule)�log)�DbusServiceObject)�handle_exceptions�dbus_handle_exceptions�dbus_service_method�dbus_polkit_require_auth)�errors)�
FirewallError)�portStr�portInPortRange�coalescePortRange�breakPortRangecs�	eZdZdZdZ	ejjZ	e	�fdd��Z
edd��Zedd��Z
ed	d
��Zeejddd
�ed�dd���Zeejddd
�ed�dd���Zeejj�eejdd�ed�dd����Zejjejdd�dd��Zeejj�eejdd�ed��fdd�	���Zeejjd d�ed�d!d"���Zeejjdd�ed�d#d$���Zd%d&�Zeejjd d�ed�d'd(���Zeejjdd�ed�d)d*���Z eejj�ed�d+d,���Z!ejjejjdd�ed-d.���Z"eejj�ed�d/d0���Z#ejjejjdd�ed1d2���Z$eejjdd�ed�d3d4���Z%ejjejjdd�ed5d6���Z&eejjdd�ed�d7d8���Z'eejjdd�ed�d9d:���Z(eejjdd�ed�d;d<���Z)eejjdd�ed�d=d>���Z*eejjdd�ed�d?d@���Z+eejjdd�ed�dAdB���Z,eejjdd�ed�dCdD���Z-eejjdd�ed�dEdF���Z.eejjdGd�ed�dHdI���Z/eejjdGd�ed�dJdK���Z0eejjdd�ed�dLdM���Z1eejjdd�ed�dNdO���Z2eejjddPd
�ed�dQdR���Z3eejjdSd�ed�dTdU���Z4eejjdSd�ed�dVdW���Z5eejjdd�ed�dXdY���Z6eejjdd�ed�dZd[���Z7eejjddPd
�ed�d\d]���Z8eejjdGd�ed�d^d_���Z9eejjdGd�ed�d`da���Z:eejjdd�ed�dbdc���Z;eejjdd�ed�ddde���Z<eejjddPd
�ed�dfdg���Z=eejjdSd�ed�dhdi���Z>eejjdSd�ed�djdk���Z?eejjdd�ed�dldm���Z@eejjdd�ed�dndo���ZAeejjddPd
�ed�dpdq���ZBeejjdGd�ed�drds���ZCeejjdGd�ed�dtdu���ZDeejjdd�ed�dvdw���ZEeejjdd�ed�dxdy���ZFeejjddPd
�ed�dzd{���ZGeejjdPd�ed�d|d}���ZHeejjdPd�ed�d~d���ZIeejj�ed�d�d����ZJeejj�ed�d�d����ZKeejjdPd�ed�d�d����ZLeejjdPd�ed�d�d����ZMeejjdPd�ed�d�d����ZNeejj�ed�d�d����ZOeejj�ed�d�d����ZPeejjdPd�ed�d�d����ZQeejjd�d�ed�d�d����ZReejjd�d�ed�d�d����ZSeejjd�d�ed�d�d����ZTeejjd�d�ed�d�d����ZUeejjd�dPd
�ed�d�d����ZVeejjdGd�ed�d�d����ZWeejjdGd�ed�d�d����ZXeejjdd�ed�d�d����ZYeejjdd�ed�d�d����ZZeejjddPd
�ed�d�d����Z[eejjdGd�ed�d�d����Z\eejjdGd�ed�d�d����Z]eejjdd�ed�d�d����Z^eejjdd�ed�d�d����Z_eejjddPd
�ed�d�d����Z`eejjdGd�ed�d�d����ZaeejjdGd�ed�d�d����Zbeejjdd�ed�d�d����Zceejjdd�ed�d�d����ZdeejjddPd
�ed�d�d����Ze�ZfS)��FirewallDConfigZonezFirewallD main classTcs`tt|�j|i|��||_||_||_||_|d|_|d|_d|j|_	t
|tjj�dS)Nr�zconfig.zone.%d)
�superr�__init__�parentr�obj�item_id�busname�path�_log_prefixr�dbus�DBUS_INTERFACE_CONFIG_ZONE)�selfr�conf�zoner�args�kwargs��	__class__��=/usr/lib/python3/dist-packages/firewall/server/config_zone.pyr8s

�zFirewallDConfigZone.__init__cCsdS�Nr)�r"r)r)r*�__del__EszFirewallDConfigZone.__del__cCs|��dSr+)�remove_from_connectionr,r)r)r*�
unregisterIszFirewallDConfigZone.unregistercCs~|dkrt�|jj�S|dkrt�|jj�S|dkr!t�|jj�S|dkr,t�|jj�S|dkr7t�|jj�Stj	�
d|��)N�name�filenamer�default�builtinzDorg.freedesktop.DBus.Error.InvalidArgs: Property '%s' does not exist)r �Stringrr0r1r�Booleanr2r3�
exceptions�
DBusException)r"�
property_namer)r)r*�
_get_propertyQs��z!FirewallDConfigZone._get_property�ss�v)�in_signature�
out_signatureNcCsLt|t�}t|t�}t�d|j||�|tjjkr!tj�	d|��|�
|�S)Nz%s.Get('%s', '%s')�Jorg.freedesktop.DBus.Error.UnknownInterface: Interface '%s' does not exist)r�strr
�debug1rrr r!r6r7r9)r"�interface_namer8�senderr)r)r*�Getbs


���
zFirewallDConfigZone.Get�sza{sv}cCs`t|t�}t�d|j|�|tjjkrtj�	d|��i}dD]	}|�
|�||<qtj|dd�S)Nz%s.GetAll('%s')r>)r0r1rr2r3�sv��	signature)rr?r
r@rrr r!r6r7r9�
Dictionary)r"rArB�ret�xr)r)r*�GetAllss
��zFirewallDConfigZone.GetAll�ssv)r<cCsht|t�}t|t�}t|�}t�d|j|||�|j�|�|tjj	kr,tj
�d|��tj
�d|��)Nz%s.Set('%s', '%s', '%s')r>zGorg.freedesktop.DBus.Error.PropertyReadOnly: Property '%s' is read-only)rr?r
r@rr�accessCheckrr r!r6r7)r"rAr8�	new_valuerBr)r)r*�Set�s$


�����zFirewallDConfigZone.Setzsa{sv}asrFcCs2t|t�}t|�}t|�}t�d|j|||�dS)Nz&%s.PropertiesChanged('%s', '%s', '%s'))rr?r
r@r)r"rA�changed_properties�invalidated_propertiesr)r)r*�PropertiesChanged�s

�z%FirewallDConfigZone.PropertiesChanged)r=cs8t�d|j�tt|��|j|j���}t	||t
jj�S)Nz%s.Introspect())
r
�debug2rrr�
Introspectrr�get_busrrr r!)r"rB�datar'r)r*rT�s
�
�zFirewallDConfigZone.Introspectz&(sssbsasa(ss)asba(ssss)asasasasa(ss)b)cCsDt�d|j�|j�|j�}|dtkr t|�}d|d<t|�}|S)�get settings for zone
        z%s.getSettings()�r2)	r
r@rr�get_zone_configrr�list�tuple)r"rB�settings�	_settingsr)r)r*�getSettings�szFirewallDConfigZone.getSettingscCs4t�d|j�|j�|j�}|dtkrd|d<|S)rWz%s.getSettings2()�targetr2)r
r@rr�get_zone_config_dictrr�r"rBr\r)r)r*�getSettings2�s
z FirewallDConfigZone.getSettings2cCs|j�|j�}d|vrt|d�nt�}d|vrt|d�nt�}t|t�r=t|t�d��|}t|t�d��|}n"d|vrGt|d�nt�}d|vrTt|d�nt�}||}||}|D]}	|j�	|	�rot
tj|	��qa|D]}
|j�
|
�r�t
tj|
��qrdS)a
Assignment of interfaces/sources to zones is different from other
           zone settings in the sense that particular interface/zone can be
           part of only one zone. So make sure added interfaces/sources have
           not already been bound to another zone.�
interfaces�sourcesN)rr`r�set�
isinstancer[r�index_ofr�getZoneOfInterfacerr�
ZONE_CONFLICT�getZoneOfSource)r"r\�old_settings�
old_ifaces�old_sources�added_ifaces�
added_sources�
new_ifaces�new_sources�iface�sourcer)r)r*� _checkDuplicateInterfacesSources�s&
���z4FirewallDConfigZone._checkDuplicateInterfacesSourcescCstt|�}t�d|j�|j�|�|ddkr#t|�}t|d<t|�}|�	|�|j
�|j|�|_|�
|jj�dS)�!update settings for zone
        z%s.update('...')rXr2N)rr
r@rrrMrZrr[rtr�set_zone_configr�Updatedr0)r"r\rBr]r)r)r*�update�s
zFirewallDConfigZone.updatecCslt|�}t�d|j�|j�|�d|vr|ddkrt|d<|�|�|j�	|j
|�|_
|�|j
j�dS)ruz%s.update2('...')r_r2N)
rr
r@rrrMrrtr�set_zone_config_dictrrwr0)r"r\rBr)r)r*�update2�s
zFirewallDConfigZone.update2cCs<t�d|j�|j�|�|j�|j�|_|�|jj	�dS)z/load default settings for builtin zone
        z%s.loadDefaults()N)
r
r@rrrMr�load_zone_defaultsrrwr0�r"rBr)r)r*�loadDefaultssz FirewallDConfigZone.loadDefaultscC�t�d|j|f�dS)Nz%s.Updated('%s')�r
r@r�r"r0r)r)r*rw
�zFirewallDConfigZone.UpdatedcCs:t�d|j�|j�|�|j�|j�|j�|j�dS)zremove zone
        z%s.removeZone()N)	r
r@rrrMr�remove_zoner�
removeZoner|r)r)r*�removeszFirewallDConfigZone.removecCr~)Nz%s.Removed('%s')rr�r)r)r*�Removedr�zFirewallDConfigZone.RemovedcCsFt|t�}t�d|j|�|j�|�|j�|j	|�|_	|�
|�dS)zrename zone
        z%s.rename('%s')N)rr?r
r@rrrMr�rename_zoner�Renamed)r"r0rBr)r)r*�rename%s

zFirewallDConfigZone.renamecCr~)Nz%s.Renamed('%s')rr�r)r)r*r�1r�zFirewallDConfigZone.RenamedcC�t�d|j�|��dS)Nz%s.getVersion()r�r
r@rr^r|r)r)r*�
getVersion8�zFirewallDConfigZone.getVersioncC�Ht|t�}t�d|j|�|j�|�t|���}||d<|�	|�dS)Nz%s.setVersion('%s')r�
rr?r
r@rrrMrZr^rx)r"�versionrBr\r)r)r*�
setVersion?�
zFirewallDConfigZone.setVersioncCr�)Nz
%s.getShort()rr�r|r)r)r*�getShortLr�zFirewallDConfigZone.getShortcCr�)Nz%s.setShort('%s')rr�)r"�shortrBr\r)r)r*�setShortSr�zFirewallDConfigZone.setShortcCr�)Nz%s.getDescription()�r�r|r)r)r*�getDescription`r�z"FirewallDConfigZone.getDescriptioncCr�)Nz%s.setDescription('%s')r�r�)r"�descriptionrBr\r)r)r*�setDescriptiongr�z"FirewallDConfigZone.setDescriptioncCs.t�d|j�|��}|dtkr|dSdS)Nz%s.getTarget()rXr2)r
r@rr^rrar)r)r*�	getTargetwszFirewallDConfigZone.getTargetcCsTt|t�}t�d|j|�|j�|�t|���}|dkr|nt	|d<|�
|�dS)Nz%s.setTarget('%s')r2rX)rr?r
r@rrrMrZr^rrx)r"r_rBr\r)r)r*�	setTargets
zFirewallDConfigZone.setTarget�ascCr�)Nz%s.getServices()�r�r|r)r)r*�getServices�r�zFirewallDConfigZone.getServicescC�Nt|t�}t�d|jd�|��|j�|�t|���}||d<|�	|�dS)Nz%s.setServices('[%s]')�,r��
rrZr
r@r�joinrrMr^rx)r"�servicesrBr\r)r)r*�setServices��

�zFirewallDConfigZone.setServicescC�ft|t�}t�d|j|�|j�|�t|���}||dvr%t	t
j|��|d�|�|�
|�dS)Nz%s.addService('%s')r��rr?r
r@rrrMrZr^rr�ALREADY_ENABLED�appendrx�r"�servicerBr\r)r)r*�
addService��
zFirewallDConfigZone.addServicecC�ft|t�}t�d|j|�|j�|�t|���}||dvr%t	t
j|��|d�|�|�
|�dS)Nz%s.removeService('%s')r��rr?r
r@rrrMrZr^rr�NOT_ENABLEDr�rxr�r)r)r*�
removeService�r�z!FirewallDConfigZone.removeService�bcC�*t|t�}t�d|j|�||��dvS)Nz%s.queryService('%s')r��rr?r
r@rr^)r"r�rBr)r)r*�queryService��
z FirewallDConfigZone.queryServiceza(ss)cCr�)Nz
%s.getPorts()�r�r|r)r)r*�getPorts�r�zFirewallDConfigZone.getPortscC�g}t|t�D]}t|t�r|�t|��q|�|�q|}t�d|jd�dd�|D���|j	�
|�t|���}||d<|�|�dS)Nz%s.setPorts('[%s]')r�cs�$�|]
}d|d|dfVqdS�z('%s, '%s')rrNr)��.0�portr)r)r*�	<genexpr>���"z/FirewallDConfigZone.setPorts.<locals>.<genexpr>r��
rrZrfr�r[r
r@rr�rrMr^rx�r"�portsrB�_portsr�r\r)r)r*�setPorts��

�zFirewallDConfigZone.setPortsc
��t|t�}t�t��t�d|j|��|j�|�t|���}tt	�fdd�|d��}|D]}t
||d�rAttj
d|�f��q.t|dd�|D��\}}|D]}	|d�t|	d	��f�qP|D]}	|d�t|	d	��f�qa|�|�dS)
Nz%s.addPort('%s', '%s')c�|d�kS�Nrr)�rJ��protocolr)r*�<lambda>��z-FirewallDConfigZone.addPort.<locals>.<lambda>r�r�%s:%scS�g|]\}}|�qSr)r)�r��_port�	_protocolr)r)r*�
<listcomp>��z/FirewallDConfigZone.addPort.<locals>.<listcomp>�-�rr?r
r@rrrMrZr^�filterrrrr�rr�rr�rx�
r"r�r�rBr\�existing_port_ids�port_id�added_ranges�removed_ranges�ranger)r�r*�addPort��(

�
��zFirewallDConfigZone.addPortc
��t|t�}t�t��t�d|j|��|j�|�t|���}tt	�fdd�|d��}|D]}t
||d�r9nq.ttj
d|�f��t|dd�|D��\}}|D]}	|d�t|	d	��f�qR|D]}	|d�t|	d	��f�qc|�|�dS)
Nz%s.removePort('%s', '%s')cr�r�r)r�r�r)r*r��r�z0FirewallDConfigZone.removePort.<locals>.<lambda>r�rr�cSr�r)r)r�r)r)r*r�r�z2FirewallDConfigZone.removePort.<locals>.<listcomp>r��rr?r
r@rrrMrZr^r�rrrr�rr�rr�rxr�r)r�r*�
removePort��&

��zFirewallDConfigZone.removePortcC�Xt|t�}t|t�}t�d|j||�|��dD]\}}t||�r)||kr)dSqdS)Nz%s.queryPort('%s', '%s')r�TF�rr?r
r@rr^r�r"r�r�rBr�r�r)r)r*�	queryPort
�

��zFirewallDConfigZone.queryPortcCr�)Nz%s.getProtocols()�
r�r|r)r)r*�getProtocolsr�z FirewallDConfigZone.getProtocolscCr�)Nz%s.setProtocols('[%s]')r�r�r�)r"�	protocolsrBr\r)r)r*�setProtocols!r�z FirewallDConfigZone.setProtocolscCr�)Nz%s.addProtocol('%s')r�r��r"r�rBr\r)r)r*�addProtocol-r�zFirewallDConfigZone.addProtocolcCr�)Nz%s.removeProtocol('%s')r�r�r�r)r)r*�removeProtocol:r�z"FirewallDConfigZone.removeProtocolcCr�)Nz%s.queryProtocol('%s')r�r�)r"r�rBr)r)r*�
queryProtocolGr�z!FirewallDConfigZone.queryProtocolcCr�)Nz%s.getSourcePorts()�r�r|r)r)r*�getSourcePortsQr�z"FirewallDConfigZone.getSourcePortscCr�)Nz%s.setSourcePorts('[%s]')r�csr�r�r)r�r)r)r*r�er�z5FirewallDConfigZone.setSourcePorts.<locals>.<genexpr>r�r�r�r)r)r*�setSourcePortsXr�z"FirewallDConfigZone.setSourcePortsc
r�)
Nz%s.addSourcePort('%s', '%s')cr�r�r)r�r�r)r*r�ur�z3FirewallDConfigZone.addSourcePort.<locals>.<lambda>r�rr�cSr�r)r)r�r)r)r*r�zr�z5FirewallDConfigZone.addSourcePort.<locals>.<listcomp>r�r�r�r)r�r*�
addSourcePortkr�z!FirewallDConfigZone.addSourcePortc
r�)
Nz%s.removeSourcePort('%s', '%s')cr�r�r)r�r�r)r*r��r�z6FirewallDConfigZone.removeSourcePort.<locals>.<lambda>r�rr�cSr�r)r)r�r)r)r*r��r�z8FirewallDConfigZone.removeSourcePort.<locals>.<listcomp>r�r�r�r)r�r*�removeSourcePort�r�z$FirewallDConfigZone.removeSourcePortcCr�)Nz%s.querySourcePort('%s', '%s')r�TFr�r�r)r)r*�querySourcePort�r�z#FirewallDConfigZone.querySourcePortcCr�)Nz%s.getIcmpBlocks()�r�r|r)r)r*�
getIcmpBlocks�r�z!FirewallDConfigZone.getIcmpBlockscCr�)Nz%s.setIcmpBlocks('[%s]')r�r�r�)r"�	icmptypesrBr\r)r)r*�
setIcmpBlocks�r�z!FirewallDConfigZone.setIcmpBlockscCr�)Nz%s.addIcmpBlock('%s')r�r��r"�icmptyperBr\r)r)r*�addIcmpBlock�r�z FirewallDConfigZone.addIcmpBlockcCr�)Nz%s.removeIcmpBlock('%s')r�r�r�r)r)r*�removeIcmpBlock�r�z#FirewallDConfigZone.removeIcmpBlockcCr�)Nz%s.queryIcmpBlock('%s')r�r�)r"r�rBr)r)r*�queryIcmpBlock�r�z"FirewallDConfigZone.queryIcmpBlockcCr�)Nz%s.getIcmpBlockInversion()�r�r|r)r)r*�getIcmpBlockInversion�r�z)FirewallDConfigZone.getIcmpBlockInversioncCr�)Nz%s.setIcmpBlockInversion('%s')r�
r�boolr
r@rrrMrZr^rx)r"�flagrBr\r)r)r*�setIcmpBlockInversion�r�z)FirewallDConfigZone.setIcmpBlockInversioncC�Pt�d|j�|j�|�t|���}|drttj	d��d|d<|�
|�dS)Nz%s.addIcmpBlockInversion()r�icmp-block-inversionT�r
r@rrrMrZr^rrr�rxrar)r)r*�addIcmpBlockInversion��z)FirewallDConfigZone.addIcmpBlockInversioncC�Pt�d|j�|j�|�t|���}|dsttj	d��d|d<|�
|�dS)Nz%s.removeIcmpBlockInversion()rrF�r
r@rrrMrZr^rrr�rxrar)r)r*�removeIcmpBlockInversion�r
z,FirewallDConfigZone.removeIcmpBlockInversioncCr�)Nz%s.queryIcmpBlockInversion()rr�r|r)r)r*�queryIcmpBlockInversionr�z+FirewallDConfigZone.queryIcmpBlockInversioncCr�)Nz%s.getMasquerade()�r�r|r)r)r*�
getMasquerader�z!FirewallDConfigZone.getMasqueradecCr�)Nz%s.setMasquerade('%s')rr)r"�
masqueraderBr\r)r)r*�
setMasquerader�z!FirewallDConfigZone.setMasqueradecCr)Nz%s.addMasquerade()rrTrrar)r)r*�
addMasquerade"r
z!FirewallDConfigZone.addMasqueradecCr)Nz%s.removeMasquerade()rrFrrar)r)r*�removeMasquerade-r
z$FirewallDConfigZone.removeMasqueradecCr�)Nz%s.queryMasquerade()rr�r|r)r)r*�queryMasquerade8r�z#FirewallDConfigZone.queryMasqueradeza(ssss)cCr�)Nz%s.getForwardPorts()�	r�r|r)r)r*�getForwardPortsAr�z#FirewallDConfigZone.getForwardPortscCr�)Nz%s.setForwardPorts('[%s]')r�css0�|]}d|d|d|d|dfVqdS)z('%s, '%s', '%s', '%s')rrr��Nr)r�r)r)r*r�Us���z6FirewallDConfigZone.setForwardPorts.<locals>.<genexpr>rr�r�r)r)r*�setForwardPortsHs


��z#FirewallDConfigZone.setForwardPorts�sssscCs�t|t�}t|t�}t|t�}t|t�}t�d|j||||�|j�|�||t|�t|�f}t|���}||dvrGt	t
jd||||f��|d�|�|�
|�dS)Nz)%s.addForwardPort('%s', '%s', '%s', '%s')r�%s:%s:%s:%sr��r"r�r��toport�toaddrrB�fwp_idr\r)r)r*�addForwardPort\�$



���z"FirewallDConfigZone.addForwardPortcCs�t|t�}t|t�}t|t�}t|t�}t�d|j||||�|j�|�||t|�t|�f}t|���}||dvrGt	t
jd||||f��|d�|�|�
|�dS)Nz,%s.removeForwardPort('%s', '%s', '%s', '%s')rrr�rr)r)r*�removeForwardPortpr!z%FirewallDConfigZone.removeForwardPortcCsbt|t�}t|t�}t|t�}t|t�}t�d|j||||�||t|�t|�f}||��dvS)Nz+%s.queryForwardPort('%s', '%s', '%s', '%s')rr�)r"r�r�rrrBrr)r)r*�queryForwardPort�s



�z$FirewallDConfigZone.queryForwardPortcCr�)Nz%s.getInterfaces()�
r�r|r)r)r*�
getInterfaces�r�z!FirewallDConfigZone.getInterfacescCr�)Nz%s.setInterfaces('[%s]')r�r$r�)r"rcrBr\r)r)r*�
setInterfaces�r�z!FirewallDConfigZone.setInterfacescCstt|t�}t�d|j|�|j�|�t|���}||dvr%t	t
j|��|d�|�|�
|�t|jj|�dS)Nz%s.addInterface('%s')r$)rr?r
r@rrrMrZr^rrr�r�rxrrr0�r"�	interfacerBr\r)r)r*�addInterface�s

z FirewallDConfigZone.addInterfacecCspt|t�}t�d|j|�|j�|�t|���}||dvr%t	t
j|��|d�|�|�
|�td|�dS)Nz%s.removeInterface('%s')r$�)rr?r
r@rrrMrZr^rrr�r�rxrr'r)r)r*�removeInterface�s

z#FirewallDConfigZone.removeInterfacecCr�)Nz%s.queryInterface('%s')r$r�)r"r(rBr)r)r*�queryInterface�s
z"FirewallDConfigZone.queryInterfacecCr�)Nz%s.getSources()�r�r|r)r)r*�
getSources�r�zFirewallDConfigZone.getSourcescCr�)Nz%s.setSources('[%s]')r�r-r�)r"rdrBr\r)r)r*�
setSources�r�zFirewallDConfigZone.setSourcescCr�)Nz%s.addSource('%s')r-r��r"rsrBr\r)r)r*�	addSource�r�zFirewallDConfigZone.addSourcecCr�)Nz%s.removeSource('%s')r-r�r0r)r)r*�removeSource�r�z FirewallDConfigZone.removeSourcecCr�)Nz%s.querySource('%s')r-r�)r"rsrBr)r)r*�querySource�r�zFirewallDConfigZone.querySourcecCr�)Nz%s.getRichRules()�r�r|r)r)r*�getRichRulesr�z FirewallDConfigZone.getRichRulescCs\t|t�}t�d|jd�|��|j�|�t|���}dd�|D�}||d<|�	|�dS)Nz%s.setRichRules('[%s]')r�cSsg|]	}tt|d���qS)��rule_str)r?r	)r��rr)r)r*r�sz4FirewallDConfigZone.setRichRules.<locals>.<listcomp>r4r�)r"�rulesrBr\r)r)r*�setRichRuless

�z FirewallDConfigZone.setRichRulescCstt|t�}t�d|j|�|j�|�t|���}tt	|d��}||dvr,t
tj|��|d�
|�|�|�dS)Nz%s.addRichRule('%s')r6r4)rr?r
r@rrrMrZr^r	rrr�r�rx�r"�rulerBr\r7r)r)r*�addRichRule�
zFirewallDConfigZone.addRichRulecCstt|t�}t�d|j|�|j�|�t|���}tt	|d��}||dvr,t
tj|��|d�
|�|�|�dS)Nz%s.removeRichRule('%s')r6r4)rr?r
r@rrrMrZr^r	rrr�r�rxr;r)r)r*�removeRichRule)r>z"FirewallDConfigZone.removeRichRulecCs8t|t�}t�d|j|�tt|d��}||��dvS)Nz%s.queryRichRule('%s')r6r4)rr?r
r@rr	r^)r"r<rBr7r)r)r*�
queryRichRule7s
z!FirewallDConfigZone.queryRichRuler+)g�__name__�
__module__�__qualname__�__doc__�
persistentrr �PK_ACTION_CONFIG�default_polkit_auth_requiredrrr
r-r/r9r�PROPERTIES_IFACErCrKrrOr��signalrR�PK_ACTION_INFO�INTROSPECTABLE_IFACErTr!r^rbrtrxrzr}rwr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrr	r
rrrrrrrrr r"r#r%r&r)r+r,r.r/r1r2r3r5r:r=r?r@�
__classcell__r)r)r'r*r0s


��


��	��

�	��
��
��
��
��	�
�
������
��	�
�
������
��	�
�
���

		���

		��������	�����	�
�
���
���r)"r �dbus.service�firewallr�firewall.dbus_utilsrrr�firewall.core.io.zoner�firewall.core.fw_ifcfgr�firewall.core.baser�firewall.core.richr	�firewall.core.loggerr
�firewall.server.dbusr�firewall.server.decoratorsrr
rrr�firewall.errorsr�firewall.functionsrrrrrr)r)r)r*�<module>s