Update invirt-vnc-client for recent token format change
[invirt/scripts/vnc-client.git] / invirt-vnc-client
index 186a0a8..a7b87e9 100755 (executable)
@@ -175,9 +175,7 @@ def main():
 
     # Unpack authentication token
     try:
 
     # Unpack authentication token
     try:
-        token_outer = base64.urlsafe_b64decode(authtoken)
-        token_outer = pickle.loads(token_outer)
-        token_inner = pickle.loads(token_outer["data"])
+        token_inner = pickle.loads(base64.urlsafe_b64decode((authtoken.split("."))[0]))
         machine = token_inner["machine"]
         connect_host = token_inner["connect_host"]
         connect_port = token_inner["connect_port"]
         machine = token_inner["machine"]
         connect_host = token_inner["connect_host"]
         connect_port = token_inner["connect_port"]
@@ -201,8 +199,7 @@ def main():
     else:
         reactor.listenTCP(listen[1], ProxyFactory(connect_host, connect_port, authtoken, machine))
     
     else:
         reactor.listenTCP(listen[1], ProxyFactory(connect_host, connect_port, authtoken, machine))
     
-    print "Ready to connect. Connect to %s:%s (display %d) now with your VNC"
-    print "client. There should be no password." % (listen[0], listen[1], listen[1]-5900)
+    print "Ready to connect. Connect to %s:%s (display %d) now with your VNC client. The password is 'moocow'." % (listen[0], listen[1], listen[1]-5900)
     print "You must connect before your authentication token expires at %s." % \
           (time.ctime(token_expires))
     
     print "You must connect before your authentication token expires at %s." % \
           (time.ctime(token_expires))