Revision: 4916
          http://tigervnc.svn.sourceforge.net/tigervnc/?rev=4916&view=rev
Author:   bphinz
Date:     2012-05-23 03:40:07 +0000 (Wed, 23 May 2012)
Log Message:
-----------
Shortened SSH tunneling System property names, fixed problem with parsing of 
'-via' cmd line option, fixed intermittent problem with SSH password dialog.

Modified Paths:
--------------
    trunk/java/com/tigervnc/vncviewer/VncViewer.java
    trunk/java/com/tigervnc/vncviewer/tunnel.java

Modified: trunk/java/com/tigervnc/vncviewer/VncViewer.java
===================================================================
--- trunk/java/com/tigervnc/vncviewer/VncViewer.java    2012-05-19 13:28:43 UTC 
(rev 4915)
+++ trunk/java/com/tigervnc/vncviewer/VncViewer.java    2012-05-23 03:40:07 UTC 
(rev 4916)
@@ -139,6 +139,7 @@
       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 @@
     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 @@
 "  \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"+

Modified: trunk/java/com/tigervnc/vncviewer/tunnel.java
===================================================================
--- trunk/java/com/tigervnc/vncviewer/tunnel.java       2012-05-19 13:28:43 UTC 
(rev 4915)
+++ trunk/java/com/tigervnc/vncviewer/tunnel.java       2012-05-23 03:40:07 UTC 
(rev 4916)
@@ -194,9 +194,9 @@
   
     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 @@
       }
       // 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");

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Tigervnc-commits mailing list
Tigervnc-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tigervnc-commits

Reply via email to