Fix for new option login

This commit is contained in:
Florian Mounier
2014-05-05 12:33:09 +02:00
parent eb869a58d2
commit eee9fdfba2

View File

@@ -137,7 +137,8 @@ class TermWebSocket(Route, tornado.websocket.WebSocketHandler):
self.callee = utils.User(name=user)
except:
self.callee = utils.User(name='nobody')
else:
elif (tornado.options.options.unsecure and not
tornado.options.options.login):
# if login is not required, we will use the same user as
# butterfly is executed
self.callee = utils.User()
@@ -171,7 +172,9 @@ class TermWebSocket(Route, tornado.websocket.WebSocketHandler):
) or not tornado.options.options.login:
# User has been auth with ssl or is the same user as server
# or login is explicitly turned off
if not tornado.options.options.unsecure:
if (
not tornado.options.options.unsecure and
tornado.options.options.login):
# User is authed by ssl, setting groups
try:
os.initgroups(self.callee.name, self.callee.gid)