diff -Naur tigervnc-1.0.90_svn4063/unix/vncviewer/CConn.cxx tigervnc-1.0.90_svn4063-magellan/unix/vncviewer/CConn.cxx --- tigervnc-1.0.90_svn4063/unix/vncviewer/CConn.cxx 2010-06-14 12:36:26.000000000 +0200 +++ tigervnc-1.0.90_svn4063-magellan/unix/vncviewer/CConn.cxx 2010-06-15 08:01:55.000000000 +0200 @@ -40,6 +40,8 @@ #include "ServerDialog.h" #include "PasswdDialog.h" #include "parameters.h" +#include +#include using namespace rfb; @@ -217,6 +219,15 @@ 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(csecurity->getType()); const char* titlePrefix = _("VNC authentication"); unsigned int titleLen = strlen(titlePrefix) + strlen(secType) + 4; diff -Naur tigervnc-1.0.90_svn4063/unix/vncviewer/parameters.h tigervnc-1.0.90_svn4063-magellan/unix/vncviewer/parameters.h --- tigervnc-1.0.90_svn4063/unix/vncviewer/parameters.h 2010-06-14 12:36:26.000000000 +0200 +++ tigervnc-1.0.90_svn4063-magellan/unix/vncviewer/parameters.h 2010-06-15 08:02:16.000000000 +0200 @@ -42,6 +42,7 @@ extern rfb::IntParameter compressLevel; extern rfb::BoolParameter noJpeg; extern rfb::IntParameter qualityLevel; +extern rfb::BoolParameter passwdInput; extern char aboutText[]; extern char* programName; diff -Naur tigervnc-1.0.90_svn4063/unix/vncviewer/vncviewer.cxx tigervnc-1.0.90_svn4063-magellan/unix/vncviewer/vncviewer.cxx --- tigervnc-1.0.90_svn4063/unix/vncviewer/vncviewer.cxx 2010-06-14 12:36:26.000000000 +0200 +++ tigervnc-1.0.90_svn4063-magellan/unix/vncviewer/vncviewer.cxx 2010-06-15 08:03:02.000000000 +0200 @@ -58,6 +58,7 @@ "manager decoration around a window", 24); StringParameter passwordFile("PasswordFile", "Password file for VNC authentication", ""); +BoolParameter passwdInput("passwdInput", "Gets password from stdin", false); AliasParameter passwd("passwd", "Alias for PasswordFile", &passwordFile); BoolParameter useLocalCursor("UseLocalCursor", diff -Naur tigervnc-1.0.90_svn4063/unix/vncviewer/vncviewer.man tigervnc-1.0.90_svn4063-magellan/unix/vncviewer/vncviewer.man --- tigervnc-1.0.90_svn4063/unix/vncviewer/vncviewer.man 2010-06-14 12:36:26.000000000 +0200 +++ tigervnc-1.0.90_svn4063-magellan/unix/vncviewer/vncviewer.man 2010-06-15 08:03:57.000000000 +0200 @@ -119,6 +119,11 @@ "~/.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