File: //usr/lib/python3/dist-packages/fail2ban/server/__pycache__/jail.cpython-310.pyc
o
;s*b1- � @ sx d Z dZdZddlZddlZddlZddlZddlmZ ddl m
Z
mZmZm
Z
dd lm
Z
e
e�ZG d
d� de�ZdS )z.Cyril Jaquier, Lee Clemens, Yaroslav HalchenkozPCopyright (c) 2004 Cyril Jaquier, 2011-2012 Lee Clemens, 2012 Yaroslav Halchenko�GPL� N� )�Actions� )� getLogger�_as_bool�extractOptions�MyTime)r c @ s e Zd ZdZg d�Zd7dd�Zdd� Zd d
� Zdd� Zd
d� Z dd� Z
dd� Zedd� �Z
edd� �Zejdd� �Zedd� �Zedd� �Zedd� �Zejdd� �Zd8d d!�Zed"d#� �Zd$d%� Zd&d'� Zd(d)� Zd9d*d+�Zd,d-� Zd:d/d0�Zd1d2� Zd;d3d4�Zd5d6� ZdS )<�Jailag Fail2Ban jail, which manages a filter and associated actions.
The class handles the initialisation of a filter, and actions. It's
role is then to act as an interface between the filter and actions,
passing bans detected by the filter, for the actions to then act upon.
Parameters
----------
name : str
Name assigned to the jail.
backend : str
Backend to be used for filter. "auto" will attempt to pick
the most preferred backend method. Default: "auto"
db : Fail2BanDb
Fail2Ban persistent database instance. Default: `None`
Attributes
----------
name
database
filter
actions
idle
status
)� pyinotify�gamin�polling�systemd�autoNc C sh || _ t|�dkrt�d| � || _t�� | _d | _i | _ t�
d| j � |d ur/| �|� || _
d S )N� z]Jail name %r might be too long and some commands might not function correctly. Please shortenzCreating new jail '%s')� _Jail__db�len�logSys�warning�_Jail__name�queue�Queue�_Jail__queue�
_Jail__filter� _banExtra�info�name�_setBackend�backend)�selfr r �db� r! �6/usr/lib/python3/dist-packages/fail2ban/server/jail.py�__init__G s �
z
Jail.__init__c C s d| j j| jf S )Nz%s(%r))� __class__�__name__r �r r! r! r"