]> source.dussan.org Git - tigervnc.git/commitdiff
Shortened SSH tunneling System property names, fixed problem with parsing of '-via...
authorBrian Hinz <bphinz@users.sourceforge.net>
Wed, 23 May 2012 03:40:07 +0000 (03:40 +0000)
committerBrian Hinz <bphinz@users.sourceforge.net>
Wed, 23 May 2012 03:40:07 +0000 (03:40 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4916 3789f03b-4d11-0410-bbf8-ca57d06f2519

java/com/tigervnc/vncviewer/VncViewer.java
java/com/tigervnc/vncviewer/tunnel.java

index a15ee58ea57118cf6ce0dfe86617b8fd282da64e..cc743945764deeb472108bee81af435f82a234f5 100644 (file)
@@ -139,6 +139,7 @@ public class VncViewer extends java.applet.Applet implements Runnable
       if (argv[i].equalsIgnoreCase("-tunnel") || argv[i].equalsIgnoreCase("-via")) {
         if (!tunnel.createTunnel(argv.length, argv, i))
           System.exit(1);
+        if (argv[i].equalsIgnoreCase("-via")) i++;
         continue;
       }
 
@@ -203,10 +204,10 @@ public class VncViewer extends java.applet.Applet implements Runnable
     String propertiesString = ("\n"+
 "\u001B[1mSystem Properties\u001B[0m (adapted from the TurboVNC vncviewer man page)\n"+
 "  When started with the -via option, vncviewer reads the\n"+
-"  \u001B[1mcom.tigervnc.VNC_VIA_CMD\u001B[0m System property, expands\n"+
+"  \u001B[1mVNC_VIA_CMD\u001B[0m System property, expands\n"+
 "  patterns beginning with the \"%\" character, and uses the resulting\n"+
 "  command line to establish the secure tunnel to the VNC gateway.\n"+
-"  If \u001B[1mcom.tigervnc.VNC_VIA_CMD\u001B[0m is not set, this \n"+
+"  If \u001B[1mVNC_VIA_CMD\u001B[0m is not set, this \n"+
 "  command line defaults to \"/usr/bin/ssh -f -L %L:%H:%R %G sleep 20\".\n"+
 "\n"+
 "  The following patterns are recognized in the VNC_VIA_CMD property\n"+
@@ -224,10 +225,10 @@ public class VncViewer extends java.applet.Applet implements Runnable
 "  \t%R     remote TCP port number.\n"+
 "\n"+
 "  When started with the -tunnel option, vncviewer reads the\n"+
-"  \u001B[1mcom.tigervnc.VNC_TUNNEL_CMD\u001B[0m System property, expands\n"+
+"  \u001B[1mVNC_TUNNEL_CMD\u001B[0m System property, expands\n"+
 "  patterns beginning with the \"%\" character, and uses the resulting\n"+
 "  command line to establish the secure tunnel to the VNC server.\n"+
-"  If \u001B[1mcom.tigervnc.VNC_TUNNEL_CMD\u001B[0m is not set, this command \n"+
+"  If \u001B[1mVNC_TUNNEL_CMD\u001B[0m is not set, this command \n"+
 "  line defaults to \"/usr/bin/ssh -f -L %L:localhost:%R %H sleep 20\".\n"+
 "\n"+
 "  The following patterns are recognized in the VNC_TUNNEL_CMD property\n"+
index 2fc12a6b07e64158c2981673382881f4dfd51459..23da0a9952765b502a05f3249294fa078a93c8d6 100644 (file)
@@ -194,9 +194,9 @@ public class tunnel
   
     try {
       if (tunnelOption) {
-        pattern = System.getProperty("com.tigervnc.VNC_TUNNEL_CMD");
+        pattern = System.getProperty("VNC_TUNNEL_CMD");
       } else {
-        pattern = System.getProperty("com.tigervnc.VNC_VIA_CMD");
+        pattern = System.getProperty("VNC_VIA_CMD");
       }
     } catch (java.lang.Exception e) { 
       vlog.info(e.toString());
@@ -294,10 +294,10 @@ public class tunnel
       }
       // username and passphrase will be given via UserInfo interface.
       PasswdDialog dlg = new PasswdDialog(new String("SSH Authentication"), false, false);
-      dlg.userEntry.setText((String)System.getProperties().get("user.name"));
+      dlg.promptPassword(new String("SSH Authentication"));
 
       Session session=jsch.getSession(dlg.userEntry.getText(), tunnelEndpoint, 22);
-      session.setUserInfo(dlg);
+      session.setPassword(new String(dlg.passwdEntry.getPassword()));
       session.connect();
 
       String[] tokens = cmd.split("\\s");