mirror of https://github.com/Mikaela/Limnoria.git
Prevent people from adding hostmasks that don't explicitly match other users'
hostmasks but will match when you check hostmaskPatternEqual aka bug #1043045
This commit is contained in:
parent
3df40e814a
commit
4557b867fe
|
@ -239,7 +239,10 @@ class User(callbacks.Privmsg):
|
|||
except ValueError, e:
|
||||
irc.error(str(e))
|
||||
return
|
||||
try:
|
||||
ircdb.users.setUser(id, user)
|
||||
except ValueError, e:
|
||||
irc.error(str(e))
|
||||
irc.replySuccess()
|
||||
|
||||
def removehostmask(self, irc, msg, args):
|
||||
|
|
|
@ -713,9 +713,11 @@ class UsersDictionary(utils.IterableMap):
|
|||
continue
|
||||
elif u.checkHostmask(hostmask):
|
||||
s = '%s is someone else\'s hostmask.' % hostmask
|
||||
user.removeHostmask(hostmask)
|
||||
raise ValueError, s
|
||||
for otherHostmask in u.hostmasks:
|
||||
if ircutils.hostmaskPatternEqual(hostmask, otherHostmask):
|
||||
user.removeHostmask(hostmask)
|
||||
s = '%s is someone else\'s hostmask.' % hostmask
|
||||
raise ValueError, s
|
||||
self.invalidateCache(id)
|
||||
|
|
Loading…
Reference in New Issue