mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-02 17:29:22 +01:00
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:
|
except ValueError, e:
|
||||||
irc.error(str(e))
|
irc.error(str(e))
|
||||||
return
|
return
|
||||||
|
try:
|
||||||
ircdb.users.setUser(id, user)
|
ircdb.users.setUser(id, user)
|
||||||
|
except ValueError, e:
|
||||||
|
irc.error(str(e))
|
||||||
irc.replySuccess()
|
irc.replySuccess()
|
||||||
|
|
||||||
def removehostmask(self, irc, msg, args):
|
def removehostmask(self, irc, msg, args):
|
||||||
|
@ -713,9 +713,11 @@ class UsersDictionary(utils.IterableMap):
|
|||||||
continue
|
continue
|
||||||
elif u.checkHostmask(hostmask):
|
elif u.checkHostmask(hostmask):
|
||||||
s = '%s is someone else\'s hostmask.' % hostmask
|
s = '%s is someone else\'s hostmask.' % hostmask
|
||||||
|
user.removeHostmask(hostmask)
|
||||||
raise ValueError, s
|
raise ValueError, s
|
||||||
for otherHostmask in u.hostmasks:
|
for otherHostmask in u.hostmasks:
|
||||||
if ircutils.hostmaskPatternEqual(hostmask, otherHostmask):
|
if ircutils.hostmaskPatternEqual(hostmask, otherHostmask):
|
||||||
|
user.removeHostmask(hostmask)
|
||||||
s = '%s is someone else\'s hostmask.' % hostmask
|
s = '%s is someone else\'s hostmask.' % hostmask
|
||||||
raise ValueError, s
|
raise ValueError, s
|
||||||
self.invalidateCache(id)
|
self.invalidateCache(id)
|
||||||
|
Loading…
Reference in New Issue
Block a user