mirror of https://github.com/cowrie/cowrie.git
add password denials
This commit is contained in:
parent
23a570ee5c
commit
2c5e5e5677
|
@ -68,8 +68,12 @@ class UserDB(object):
|
|||
def checklogin(self, thelogin, thepasswd):
|
||||
'''check entered username/password against database'''
|
||||
'''note that it allows multiple passwords for a single username'''
|
||||
|
||||
'''it also knows wildcard '*' for any password'''
|
||||
'''prepend password with ! to explicitly deny it. Denials must come before wildcards'''
|
||||
for (login, uid, passwd) in self.userdb:
|
||||
# explicitly fail on !password
|
||||
if login == thelogin and passwd == '!'+thepasswd:
|
||||
return False
|
||||
if login == thelogin and passwd in (thepasswd, '*'):
|
||||
return True
|
||||
return False
|
||||
|
|
Loading…
Reference in New Issue