Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix more typos #3636

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
35 changes: 35 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[files]
extend-exclude = [
".git/",
".codespellrc",
"fail2ban/tests/files/logs/",
]
ignore-hidden = false

[default]
extend-ignore-re = [
"Christoph Theis",
"\\[[0-9a-f]{7,8}\\]",
"hash_[0-9a-f]{38}",
"\t[0-9.-]+[ A-Z]+",
"Erreur d'authentification",
"WebEMailExtrac",
"ssh2: RSA 14:ba:xx",
"\\[Cc\\]lient",

Check failure on line 18 in .typos.toml

View workflow job for this annotation

GitHub Actions / Check for spelling errors

lient ==> client
"\\[Gg\\]ot",

Check failure on line 19 in .typos.toml

View workflow job for this annotation

GitHub Actions / Check for spelling errors

ot ==> to, of, or, not
"\\[nN\\]ot",

Check failure on line 20 in .typos.toml

View workflow job for this annotation

GitHub Actions / Check for spelling errors

ot ==> to, of, or, not
"\\[Uu\\]nknown",

Check failure on line 21 in .typos.toml

View workflow job for this annotation

GitHub Actions / Check for spelling errors

nknown ==> unknown
"\\[uU\\]ser",

Check failure on line 22 in .typos.toml

View workflow job for this annotation

GitHub Actions / Check for spelling errors

ser ==> set
"\\[Uu\\]\\(\\?:ser",

Check failure on line 23 in .typos.toml

View workflow job for this annotation

GitHub Actions / Check for spelling errors

ser ==> set
]

[default.extend-words]
"alls" = "alls"
"helo" = "helo"

[default.extend-identifiers]
"failManager2nd" = "failManager2nd"
"log2nd" = "log2nd"
"routeros" = "routeros"
"REFERERS" = "REFERERS"
"tre_search" = "tre_search"
2 changes: 1 addition & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -2558,7 +2558,7 @@ ver. 0.3.1 (2005/03/31) - beta

ver. 0.3.0 (2005/02/24) - beta
----------
- Re-writting of parts of the code in order to handle several log files with
- Re-writing of parts of the code in order to handle several log files with
different rules
- Removed `sshd.py` because it is no more needed
- Fixed a bug when exiting with IP in the ban list
Expand Down
2 changes: 1 addition & 1 deletion config/action.d/complain.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#
# Please do not use this action unless you are certain that fail2ban
# does not result in "false positives" for your deployment. False
# positive reports could serve a mis-favor to the original cause by
# positive reports could serve a misfavor to the original cause by
# flooding corresponding contact addresses, and complicating the work
# of administration personnel responsible for handling (verified) legit
# complains.
Expand Down
2 changes: 1 addition & 1 deletion config/action.d/ipthreat.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# Reporting an IP is a serious action. Make sure that it is legit.
# Consider using this action only for:
# * IP that has been banned more than once
# * High max retry to avoid user mis-typing password
# * High max retry to avoid user mistyping password
# * Filters that are unlikely to be human error
#
# Example:
Expand Down
2 changes: 1 addition & 1 deletion fail2ban/client/configreader.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ def getCombined(self, ignore=()):
if cond:
n, cond = cond.groups()
ignore.add(n)
# substiture options already specified direct:
# substitute options already specified direct:
opts = substituteRecursiveTags(combinedopts,
ignore=ignore, addrepl=self.getCombOption)
if not opts:
Expand Down
2 changes: 1 addition & 1 deletion fail2ban/client/fail2banregex.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def dumpNormVersion(*args):

class _f2bOptParser(OptionParser):
def format_help(self, *args, **kwargs):
""" Overwritten format helper with full ussage."""
""" Overwritten format helper with full usage."""
self.usage = ''
return "Usage: " + usage() + "\n" + __doc__ + """
LOG:
Expand Down
2 changes: 1 addition & 1 deletion fail2ban/server/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ def getBansMerged(self, ip=None, jail=None, bantime=None):
failures = 0
tickdata = {}
m = data.get('matches', [])
# pre-insert "maxadd" enries (because tickets are ordered desc by time)
# pre-insert "maxadd" entries (because tickets are ordered desc by time)
maxadd = self.maxMatches - len(matches)
if maxadd > 0:
if len(m) <= maxadd:
Expand Down
2 changes: 1 addition & 1 deletion fail2ban/server/jailthread.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def run(self): # pragma: no cover - absract
def join(self):
""" Safer join, that could be called also for not started (or ended) threads (used for cleanup).
"""
## if cleanup needed - create derivate and call it before join...
## if cleanup needed - create derivative and call it before join...

## if was really started - should call join:
if self.active is not None:
Expand Down
6 changes: 3 additions & 3 deletions fail2ban/tests/actionstestcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def testActionsManipulation(self):
self.__actions.add('test')
self.assertTrue(self.__actions['test'])
self.assertIn('test', self.__actions)
self.assertNotIn('nonexistant action', self.__actions)
self.assertNotIn('nonexistent action', self.__actions)
self.__actions.add('test1')
del self.__actions['test']
del self.__actions['test1']
Expand Down Expand Up @@ -287,7 +287,7 @@ def testActionsConsistencyCheck(self):
# no flush for inet4 (already successfully flushed):
self.assertNotLogged("ERROR",
"stdout: %r" % 'ip flush inet4',
'Unban tickets each individualy',
'Unban tickets each individually',
all=True)

def testActionsConsistencyCheckDiffFam(self):
Expand Down Expand Up @@ -401,7 +401,7 @@ def testActionsConsistencyCheckDiffFam(self):
# no flush for inet4 (already successfully flushed):
self.assertNotLogged("ERROR",
"stdout: %r" % 'ip flush inet4',
'Unban tickets each individualy',
'Unban tickets each individually',
all=True)

@with_alt_time
Expand Down
10 changes: 5 additions & 5 deletions fail2ban/tests/clientreadertestcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ def testConvertOptions(self):
self.assertNotEqual(opts['maxlines'], 'X'); # wrong int value 'X' for 'maxlines'
self.assertLogged("Wrong int value 'X' for 'maxlines'. Using default one:")

def testFilterReaderSubstitionDefault(self):
def testFilterReaderSubstitutionDefault(self):
output = [['set', 'jailname', 'addfailregex', 'to=sweet@example.com fromip=<IP>']]
filterReader = FilterReader('substitution', "jailname", {},
share_config=TEST_FILES_DIR_SHARE_CFG, basedir=TEST_FILES_DIR)
Expand All @@ -583,7 +583,7 @@ def testFilterReaderSubstKnown(self):
opts = filterReader.getCombined()
self.assertTrue('sshd' in opts['failregex'])

def testFilterReaderSubstitionSet(self):
def testFilterReaderSubstitutionSet(self):
output = [['set', 'jailname', 'addfailregex', 'to=sour@example.com fromip=<IP>']]
filterReader = FilterReader('substitution', "jailname", {'honeypot': 'sour@example.com'},
share_config=TEST_FILES_DIR_SHARE_CFG, basedir=TEST_FILES_DIR)
Expand All @@ -592,7 +592,7 @@ def testFilterReaderSubstitionSet(self):
c = filterReader.convert()
self.assertSortedEqual(c, output)

def testFilterReaderSubstitionKnown(self):
def testFilterReaderSubstitutionKnown(self):
output = [['set', 'jailname', 'addfailregex', '^to=test,sweet@example.com,test2,sweet@example.com fromip=<IP>$']]
filterName, filterOpt = extractOptions(
'substitution[failregex="^<known/failregex>$", honeypot="<sweet>,<known/honeypot>", sweet="test,<known/honeypot>,test2"]')
Expand All @@ -603,7 +603,7 @@ def testFilterReaderSubstitionKnown(self):
c = filterReader.convert()
self.assertSortedEqual(c, output)

def testFilterReaderSubstitionSection(self):
def testFilterReaderSubstitutionSection(self):
output = [['set', 'jailname', 'addfailregex', '^\\s*to=fail2ban@localhost fromip=<IP>\\s*$']]
filterName, filterOpt = extractOptions(
'substitution[failregex="^\\s*<Definition/failregex>\\s*$", honeypot="<default/honeypot>"]')
Expand All @@ -614,7 +614,7 @@ def testFilterReaderSubstitionSection(self):
c = filterReader.convert()
self.assertSortedEqual(c, output)

def testFilterReaderSubstitionFail(self):
def testFilterReaderSubstitutionFail(self):
# directly subst the same var :
filterReader = FilterReader('substitution', "jailname", {'honeypot': '<honeypot>'},
share_config=TEST_FILES_DIR_SHARE_CFG, basedir=TEST_FILES_DIR)
Expand Down
2 changes: 1 addition & 1 deletion fail2ban/tests/datedetectortestcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ def testVariousFormatSpecs(self):
else: # pragma: no cover
self.assertEqual(date, None)

# def testDefaultTempate(self):
# def testDefaultTemplate(self):
# self.__datedetector.setDefaultRegex("^\S{3}\s{1,2}\d{1,2} \d{2}:\d{2}:\d{2}")
# self.__datedetector.setDefaultPattern("%b %d %H:%M:%S")
#
Expand Down
6 changes: 3 additions & 3 deletions fail2ban/tests/fail2banregextestcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def testWrongRE(self):
self.assertLogged("Unable to compile regular expression")
self.assertLogged("unknown group name", "at position 23", all=False); # details of failed compilation

def testWrongIngnoreRE(self):
def testWrongIgnoreRE(self):
self.assertFalse(_test_exec(
"--datepattern", "{^LN-BEG}EPOCH",
"test", r".*? from <HOST>$", r".**"
Expand Down Expand Up @@ -557,7 +557,7 @@ def testWrongFilterFile(self):
FILENAME_ZZZ_GEN, FILENAME_ZZZ_GEN
))

def testWronChar(self):
def testWrongChar(self):
unittest.F2B.SkipIfCfgMissing(stock=True)
self.assertTrue(_test_exec(
"-l", "notice", # put down log-level, because of too many debug-messages
Expand All @@ -572,7 +572,7 @@ def testWronChar(self):
self.assertLogged('Nov 8 00:16:12 main sshd[32548]: input_userauth_request: invalid user llinco')
self.assertLogged('Nov 8 00:16:12 main sshd[32547]: pam_succeed_if(sshd:auth): error retrieving information about user llinco')

def testWronCharDebuggex(self):
def testWrongCharDebuggex(self):
unittest.F2B.SkipIfCfgMissing(stock=True)
self.assertTrue(_test_exec(
"-l", "notice", # put down log-level, because of too many debug-messages
Expand Down
2 changes: 1 addition & 1 deletion fail2ban/tests/files/config/apache-auth/README
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Apache Auth.
This directory contains the configuration file of Apache's Web Server to
simulate authentication files.

These assumed that /var/www/html is the web root and AllowOverides is "All".
These assumed that /var/www/html is the web root and AllowOverrides is "All".

The subdirectories here are copied to the /var/www/html directory.

Expand Down
6 changes: 3 additions & 3 deletions fail2ban/tests/filtertestcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -1521,7 +1521,7 @@ def _test_grow_file(self, idle=False):
@with_alt_time
def test_grow_file_with_db(self):

def _gen_falure(ip):
def _gen_failure(ip):
# insert new failures ans check it is monitored:
fields = self.journal_fields
fields.update(TEST_JOURNAL_FIELDS)
Expand All @@ -1547,7 +1547,7 @@ def _gen_falure(ip):
self.filter.start()
self.waitForTicks(2)
# check new IP but no old IPs found:
_gen_falure("192.0.2.5")
_gen_failure("192.0.2.5")
self.assertFalse(self.jail.getFailTicket())

# now the same with increased time (check now - findtime case):
Expand All @@ -1561,7 +1561,7 @@ def _gen_falure(ip):
self.waitForTicks(2)
MyTime.setTime(time.time() + 20)
# check new IP but no old IPs found:
_gen_falure("192.0.2.6")
_gen_failure("192.0.2.6")
self.assertFalse(self.jail.getFailTicket())

# now reset DB, so we'd find all messages before filter entering in operation mode:
Expand Down