HEX
Server: Apache/2.4.65 (Debian)
System: Linux kubikelcreative 5.10.0-35-amd64 #1 SMP Debian 5.10.237-1 (2025-05-19) x86_64
User: www-data (33)
PHP: 8.4.13
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/fail2ban/client/__pycache__/jailsreader.cpython-39.pyc
a

��_��@sLdZdZdZddlmZddlmZddlmZee	�Z
Gdd	�d	e�Zd
S)z
Cyril Jaquierz Copyright (c) 2004 Cyril JaquierZGPL�)�ConfigReader)�
JailReader�)�	getLoggerc@s>eZdZddd�Zedd��Zdd�Zdd
d�Zddd
�ZdS)�JailsReaderFcKs$tj|fi|��t�|_||_dS)z�
		Parameters
		----------
		force_enable : bool, optional
		  Passed to JailReader to force enable the jails.
		  It is for internal use
		N)r�__init__�list�_JailsReader__jails�_JailsReader__force_enable)�self�force_enable�kwargs�r�=/usr/lib/python3/dist-packages/fail2ban/client/jailsreader.pyr%szJailsReader.__init__cCs|jS)N)r	�rrrr�jails1szJailsReader.jailscCst�|_t�|d�S)N�jail)rr	r�readrrrrr5szJailsReader.readNTc	Cs�g}t�|d|�|_|dur&|��}n|g}d}|D]x}|dkrBq4t||j|j|jd�}|��}|r�|��r�|dO}|j	�
|�q4t�d||r�dnd	�|j	�
|�|d
O}q4|r�|d@p�|d
@S)zDReads configuration for jail(s) and adds enabled jails to __jails
		Z
DefinitionN�ZINCLUDES)r�share_configZ
use_configrzErrors in jail %r.%sz Skipping...�r)
r�
getOptionsZ_JailsReader__opts�sectionsrr
rZ_cfgZ	isEnabledr	�append�logSys�error)	rZsectionZignoreWrongZoptsrZparse_statusZsecrZretrrrr9s*
�
zJailsReader.getOptionscCsRt�}|jD]}|�|j|d��q|jD]"}|j�d�s*|�d|��g�q*|S)z�Convert read before __opts and jails to the commands stream

		Parameters
		----------
		allow_missing : bool
		  Either to allow log files to be missing entirely.  Primarily is
		  used for testing
		)�allow_no_fileszconfig-error�start)rr	�extend�convertZoptions�getrZgetName)rr�streamrrrrr[s


zJailsReader.convert)F)NT)F)	�__name__�
__module__�__qualname__r�propertyrrrrrrrrr#s


"rN)�
__author__Z
__copyright__Z__license__ZconfigreaderrZ
jailreaderrZhelpersrr"rrrrrr�<module>s