don't let user set password to '*'

This commit is contained in:
Upi Tamminen
2014-06-13 18:15:51 +03:00
parent 4b4ae526d5
commit 36f2bc43b6
2 changed files with 2 additions and 2 deletions

View File

@@ -169,7 +169,7 @@ class command_passwd(HoneyPotCommand):
def finish(self, line): def finish(self, line):
self.honeypot.password_input = False self.honeypot.password_input = False
if line != self.passwd: if line != self.passwd or self.passwd == '*':
self.writeln('Sorry, passwords do not match') self.writeln('Sorry, passwords do not match')
self.exit() self.exit()
return return

View File

@@ -59,7 +59,7 @@ class UserDB:
'''note that it allows multiple passwords for a single username''' '''note that it allows multiple passwords for a single username'''
for (login, uid, passwd) in self.userdb: for (login, uid, passwd) in self.userdb:
if login == thelogin and (passwd == thepasswd or passwd == '*'): if login == thelogin and passwd in (thepasswd, '*'):
return True return True
return False return False