From 57aa844fcb77361af8002307cc6215a0477160e1 Mon Sep 17 00:00:00 2001 From: James Lu Date: Fri, 9 Dec 2016 20:51:04 -0800 Subject: [PATCH] permissions: limit "login = admin access" to old-style (< 1.1) login blocks --- coremods/permissions.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/coremods/permissions.py b/coremods/permissions.py index 15cd72c..66ab886 100644 --- a/coremods/permissions.py +++ b/coremods/permissions.py @@ -58,9 +58,11 @@ def checkPermissions(irc, uid, perms, also_show=[]): Checks permissions of the caller. If the caller has any of the permissions listed in perms, this function returns True. Otherwise, NotAuthorizedError is raised. """ + # For old (< 1.1 login blocks): # If the user is logged in, they automatically have all permissions. - if irc.matchHost('$pylinkacc', uid): - log.debug('permissions: overriding permissions check for admin user %s', irc.getHostmask(uid)) + if irc.matchHost('$pylinkacc', uid) and conf.conf['login'].get('user'): + log.debug('permissions: overriding permissions check for old-style admin user %s', + irc.getHostmask(uid)) return True # Iterate over all hostmask->permission list mappings.