If an invalid password is specified *and* the hostmask isn't recognized we

need to watch for a KeyError instead of assuming it is the owner trying to
register a hostmask for another user.
This commit is contained in:
James Vega 2004-06-09 23:44:49 +00:00
parent 32f39e0980
commit 06e92cdcb2

View File

@ -222,7 +222,11 @@ class User(callbacks.Privmsg):
pass
if not user.checkPassword(password) and \
not user.checkHostmask(msg.prefix):
try:
u = ircdb.users.getUser(msg.prefix)
except KeyError:
irc.error(conf.supybot.replies.incorrectAuthentication())
return
if not u.checkCapability('owner'):
irc.error(conf.supybot.replies.incorrectAuthentication())
return