Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 204731 Details for
Bug 285757
net-misc/tigervnc add patch to not show the xdialog when started from the command line
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
vnc-4.1.3-tty-password.patch
vnc-4.1.3-tty-password.patch (text/plain), 5.58 KB, created by
Georgi Georgiev
on 2009-09-20 19:15:53 UTC
(
hide
)
Description:
vnc-4.1.3-tty-password.patch
Filename:
MIME Type:
Creator:
Georgi Georgiev
Created:
2009-09-20 19:15:53 UTC
Size:
5.58 KB
patch
obsolete
>diff -ruN vnc-4_1_3-unixsrc.orig/unix/vncviewer/CConn.cxx vnc-4_1_3-unixsrc/unix/vncviewer/CConn.cxx >--- vnc-4_1_3-unixsrc.orig/unix/vncviewer/CConn.cxx 2009-09-21 03:57:57.614753050 +0900 >+++ vnc-4_1_3-unixsrc/unix/vncviewer/CConn.cxx 2009-09-21 03:58:42.937586424 +0900 >@@ -19,6 +19,8 @@ > // CConn.cxx > // > >+#include <termios.h> >+#include <stdio.h> > #include <unistd.h> > #include "CConn.h" > #include <rfb/CMsgWriter.h> >@@ -88,11 +90,20 @@ > if (vncServerName) { > getHostAndPort(vncServerName, &serverHost, &serverPort); > } else { >- ServerDialog dlg(dpy, &options, &about); >- if (!dlg.show() || dlg.entry.getText()[0] == 0) { >- exit(1); >+ int popup = popupXDialog; >+ if (!popup) { >+ /* Get server */ >+ fprintf(stderr, "\nServer: "); >+ vncServerName = new char[128]; >+ fgets(vncServerName, 128, stdin); >+ getHostAndPort(vncServerName, &serverHost, &serverPort); >+ } else { >+ ServerDialog dlg(dpy, &options, &about); >+ if (!dlg.show() || dlg.entry.getText()[0] == 0) { >+ exit(1); >+ } >+ getHostAndPort(dlg.entry.getText(), &serverHost, &serverPort); > } >- getHostAndPort(dlg.entry.getText(), &serverHost, &serverPort); > } > > sock = new network::TcpSocket(serverHost, serverPort); >@@ -196,6 +207,9 @@ > > void CConn::getUserPasswd(char** user, char** password) > { >+ struct termios oldio; >+ struct termios newio; >+ > CharArray passwordFileStr(passwordFile.getData()); > if (!user && passwordFileStr.buf[0]) { > FILE* fp = fopen(passwordFileStr.buf, "r"); >@@ -217,15 +231,49 @@ > return; > } > >- const char* secType = secTypeName(getCurrentCSecurity()->getType()); >- const char* titlePrefix = "VNC Authentication"; >- CharArray title(strlen(titlePrefix) + strlen(secType) + 4); >- sprintf(title.buf, "%s [%s]", titlePrefix, secType); >- PasswdDialog dlg(dpy, title.buf, !user); >- if (!dlg.show()) throw rfb::Exception("Authentication cancelled"); >- if (user) >- *user = strDup(dlg.userEntry.getText()); >- *password = strDup(dlg.passwdEntry.getText()); >+ int popup = popupXDialog; >+ if (!popup) { >+ if (user) { >+ /* Get username */ >+ fprintf(stderr, "\nUsername: "); >+ *user = new char[128]; >+ fgets(*user, 128, stdin); >+ /* Remove \n at the end */ >+ (*user)[strlen(*user)-1] = '\0'; >+ } >+ >+ if (tcgetattr (fileno (stdin), &oldio) != 0) { >+ popup = 1; >+ } else { >+ newio = oldio; >+ newio.c_lflag &= ~ECHO; >+ fprintf(stderr, "\nPassword: "); >+ /* Echo off */ >+ if (tcsetattr (fileno (stdin), TCSAFLUSH, &newio) != 0) >+ popup = 1; >+ >+ /* Read the password. */ >+ *password = new char[64]; >+ fgets (*password, 64, stdin); >+ /* Remove \n at the end */ >+ (*password)[strlen(*password)-1] = '\0'; >+ >+ /* Restore terminal. */ >+ (void) tcsetattr (fileno (stdin), TCSAFLUSH, &oldio); >+ } >+ } >+ >+ if (popup) { >+ const char* secType = secTypeName(getCurrentCSecurity()->getType()); >+ const char* titlePrefix = "VNC Authentication"; >+ CharArray title(strlen(titlePrefix) + strlen(secType) + 4); >+ sprintf(title.buf, "%s [%s]", titlePrefix, secType); >+ PasswdDialog dlg(dpy, title.buf, !user); >+ if (!dlg.show()) throw rfb::Exception("Authentication cancelled"); >+ if (user) >+ *user = strDup(dlg.userEntry.getText()); >+ *password = strDup(dlg.passwdEntry.getText()); >+ } > } > > >diff -ruN vnc-4_1_3-unixsrc.orig/unix/vncviewer/parameters.h vnc-4_1_3-unixsrc/unix/vncviewer/parameters.h >--- vnc-4_1_3-unixsrc.orig/unix/vncviewer/parameters.h 2009-09-21 03:57:57.614753050 +0900 >+++ vnc-4_1_3-unixsrc/unix/vncviewer/parameters.h 2009-09-21 03:58:59.986702977 +0900 >@@ -39,6 +39,7 @@ > extern rfb::StringParameter geometry; > extern rfb::StringParameter embedParent; > extern rfb::BoolParameter passwdInput; >+extern rfb::BoolParameter popupXDialog; > > extern char aboutText[]; > extern char* programName; >diff -ruN vnc-4_1_3-unixsrc.orig/unix/vncviewer/vncviewer.cxx vnc-4_1_3-unixsrc/unix/vncviewer/vncviewer.cxx >--- vnc-4_1_3-unixsrc.orig/unix/vncviewer/vncviewer.cxx 2009-09-21 03:57:57.614753050 +0900 >+++ vnc-4_1_3-unixsrc/unix/vncviewer/vncviewer.cxx 2009-09-21 03:58:42.941586540 +0900 >@@ -94,6 +94,11 @@ > > BoolParameter listenMode("listen", "Listen for connections from VNC servers", > false); >+BoolParameter popupXDialog("XDialog", >+ "Popup an X dialog when asking for server, " >+ "username and password. Default no when " >+ "running from command line", >+ !isatty(0)); > StringParameter geometry("geometry", "X geometry specification", ""); > StringParameter displayname("display", "The X display", ""); > >diff -ruN vnc-4_1_3-unixsrc.orig/unix/vncviewer/vncviewer.man vnc-4_1_3-unixsrc/unix/vncviewer/vncviewer.man >--- vnc-4_1_3-unixsrc.orig/unix/vncviewer/vncviewer.man 2009-09-21 03:57:58.594832360 +0900 >+++ vnc-4_1_3-unixsrc/unix/vncviewer/vncviewer.man 2009-09-21 03:58:42.941586540 +0900 >@@ -1,4 +1,4 @@ >-.TH vncviewer 1 "03 Mar 2005" "RealVNC Ltd" "Virtual Network Computing" >+.TH vncviewer 1 "08 Nov 2006" "RealVNC Ltd" "Virtual Network Computing" > .SH NAME > vncviewer \- VNC viewer for X > .SH SYNOPSIS >@@ -106,6 +106,11 @@ > .B vncconfig. > > .TP >+.B \-XDialog >+Popup an X dialog when asking for server, username and password. Default is to >+not popup when vncviewer is start from command line. >+ >+.TP > .B \-passwd \fIpassword-file\fP > If you are on a filesystem which gives you access to the password file used by > the server, you can specify it here to avoid typing it in. It will usually be
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 285757
: 204731 |
204733
|
210392