fix group-whitelist checks

and test it
This commit is contained in:
Min RK
2015-04-06 17:36:41 -07:00
parent d9fc40652d
commit 04b7056591
2 changed files with 42 additions and 3 deletions

View File

@@ -126,11 +126,11 @@ class LocalAuthenticator(Authenticator):
def check_group_whitelist(self, username):
if not self.group_whitelist:
return False
for group in self.group_whitelist:
for grnam in self.group_whitelist:
try:
group = getgrnam(self.group_whitelist)
group = getgrnam(grnam)
except KeyError:
self.log.error('No such group: [%s]' % self.group_whitelist)
self.log.error('No such group: [%s]' % grnam)
continue
if username in group.gr_mem:
return True