X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-web.git/blobdiff_plain/4aa59cefff165e527b2a32642fea1be3c983705c..dec9bc422854b7afc6d3ea998530fb27f1f17cdf:/code/main.py diff --git a/code/main.py b/code/main.py index 5037a09..cf1424a 100755 --- a/code/main.py +++ b/code/main.py @@ -246,7 +246,7 @@ def vnc(username, state, path, fields): """ machine = validation.Validate(username, state, machine_id=fields.getfirst('machine_id')).machine - token = control.vnctoken(machine) + token = controls.vnctoken(machine) host = controls.listHost(machine) if host: port = 10003 + [h.hostname for h in config.hosts].index(host) @@ -430,8 +430,8 @@ def helpHandler(username, state, path, fields): help_mapping = {'ParaVM Console': """ ParaVM machines do not support local console access over VNC. To access the serial console of these machines, you can SSH with Kerberos -to console.%s, using the name of the machine as your -username.""" % config.dns.domains[0], +to %s, using the name of the machine as your +username.""" % config.console.hostname, 'HVM/ParaVM': """ HVM machines use the virtualization features of the processor, while ParaVM machines use Xen's emulation of virtualization features. You @@ -652,7 +652,18 @@ def show_error(op, username, fields, err, emsg, traceback): def getUser(environ): """Return the current user based on the SSL environment variables""" - return environ.get('REMOTE_USER', None) + user = environ.get('REMOTE_USER') + if user is None: + return + + if environ.get('AUTH_TYPE') == 'Negotiate': + # Convert the krb5 principal into a krb4 username + if not user.endswith('@%s' % config.authn[0].realm): + return + else: + return user.split('@')[0].replace('/', '.') + else: + return user def handler(username, state, path, fields): operation, path = pathSplit(path)