fail2ban/debian/patches/00_HOST_ignoreregex.dpatch

35 lines
1.3 KiB
Plaintext
Raw Normal View History

#! /bin/sh /usr/share/dpatch/dpatch-run
## 00_HOST_ignoreregex.dpatch by Yaroslav Halchenko <debian@onerussian.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.
@DPATCH@
diff -urNad trunk~/server/failregex.py trunk/server/failregex.py
--- trunk~/server/failregex.py 2007-05-05 21:30:22.000000000 -0400
+++ trunk/server/failregex.py 2007-06-19 23:00:45.000000000 -0400
@@ -40,9 +40,7 @@
# avoid construction of invalid object.
# @param value the regular expression
- def __init__(self, value):
- # Replace "<HOST>" with default regular expression for host.
- regex = value.replace("<HOST>", "(?:::f{4,6}:)?(?P<host>\S+)")
+ def __init__(self, regex):
# Initializes the parent.
Regex.__init__(self, regex)
# Check for group "host"
diff -urNad trunk~/server/regex.py trunk/server/regex.py
--- trunk~/server/regex.py 2007-05-05 21:30:22.000000000 -0400
+++ trunk/server/regex.py 2007-06-19 23:00:21.000000000 -0400
@@ -42,6 +42,9 @@
def __init__(self, regex):
self._matchCache = None
+ # Perform shortcuts expansions
+ # Replace "<HOST>" with default regular expression for host.
+ regex = regex.replace("<HOST>", "(?:::f{4,6}:)?(?P<host>\S+)")
if regex.lstrip() == '':
raise RegexException("Cannot add empty regex")
try: