sharkcz / rpms / tigervnc

Forked from rpms/tigervnc 4 years ago
Clone
Blob Blame History Raw
diff -up tightvnc-1.5.0-20081015svn3022/unix/vncviewer/CConn.cxx.102434 tightvnc-1.5.0-20081015svn3022/unix/vncviewer/CConn.cxx
--- tightvnc-1.5.0-20081015svn3022/unix/vncviewer/CConn.cxx.102434	2008-10-10 17:48:22.000000000 +0200
+++ tightvnc-1.5.0-20081015svn3022/unix/vncviewer/CConn.cxx	2008-10-22 18:35:46.000000000 +0200
@@ -37,6 +37,8 @@
 #include "ServerDialog.h"
 #include "PasswdDialog.h"
 #include "parameters.h"
+#include <string>
+#include <iostream>
 
 using namespace rfb;
 
@@ -209,6 +211,15 @@ void CConn::getUserPasswd(char** user, c
     return;
   }
 
+  /* XXX Who wrote this code? Yes, it is really ugly */
+  if (passwdInput) {
+    std::string s;
+    std::cin >> s;
+    *password = strdup(s.c_str());
+    if(user) *user = 0;
+      return;
+  }
+
   const char* secType = secTypeName(getCurrentCSecurity()->getType());
   const char* titlePrefix = _("VNC authentication");
   unsigned int titleLen = strlen(titlePrefix) + strlen(secType) + 4;
diff -up tightvnc-1.5.0-20081015svn3022/unix/vncviewer/parameters.h.102434 tightvnc-1.5.0-20081015svn3022/unix/vncviewer/parameters.h
--- tightvnc-1.5.0-20081015svn3022/unix/vncviewer/parameters.h.102434	2006-05-18 13:08:21.000000000 +0200
+++ tightvnc-1.5.0-20081015svn3022/unix/vncviewer/parameters.h	2008-10-22 18:08:47.000000000 +0200
@@ -41,6 +41,7 @@ extern rfb::BoolParameter customCompress
 extern rfb::IntParameter compressLevel;
 extern rfb::BoolParameter noJpeg;
 extern rfb::IntParameter qualityLevel;
+extern rfb::BoolParameter passwdInput;
 
 extern char aboutText[];
 extern char* programName;
diff -up tightvnc-1.5.0-20081015svn3022/unix/vncviewer/vncviewer.cxx.102434 tightvnc-1.5.0-20081015svn3022/unix/vncviewer/vncviewer.cxx
--- tightvnc-1.5.0-20081015svn3022/unix/vncviewer/vncviewer.cxx.102434	2008-09-28 07:08:48.000000000 +0200
+++ tightvnc-1.5.0-20081015svn3022/unix/vncviewer/vncviewer.cxx	2008-10-22 18:04:00.000000000 +0200
@@ -58,6 +58,7 @@ IntParameter wmDecorationHeight("WMDecor
                                 "manager decoration around a window", 24);
 StringParameter passwordFile("PasswordFile",
                              "Password file for VNC authentication", "");
+BoolParameter passwdInput("passwdInput", "Gets password from stdin", false);
 AliasParameter rfbauth("passwd", "Alias for PasswordFile", &passwordFile);
 
 BoolParameter useLocalCursor("UseLocalCursor",
diff -up tightvnc-1.5.0-20081015svn3022/unix/vncviewer/vncviewer.man.102434 tightvnc-1.5.0-20081015svn3022/unix/vncviewer/vncviewer.man
--- tightvnc-1.5.0-20081015svn3022/unix/vncviewer/vncviewer.man.102434	2006-06-02 06:43:52.000000000 +0200
+++ tightvnc-1.5.0-20081015svn3022/unix/vncviewer/vncviewer.man	2008-10-22 18:04:00.000000000 +0200
@@ -115,6 +115,11 @@ the server, you can specify it here to a
 "~/.vnc/passwd".
 
 .TP
+.B \-passwdInput \fItrue, false\fP
+Force standard vnc dialog to getting password and reads password from stdin.
+Default is false(shows dialog window)
+
+.TP
 .B \-Shared
 When you make a connection to a VNC server, all other existing connections are
 normally closed.  This option requests that they be left open, allowing you to