summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authordscho <dscho>2001-10-11 15:44:58 +0000
committerdscho <dscho>2001-10-11 15:44:58 +0000
commit67094d7c281993497decb1459ea1663765a760eb (patch)
tree6317d81c1ddca58b5e3b8e1556ae9b904e0d160b /main.c
parent519a8e0e399bf44893f2d61a3676f3257ab8d201 (diff)
downloadlibtdevnc-67094d7c281993497decb1459ea1663765a760eb.tar.gz
libtdevnc-67094d7c281993497decb1459ea1663765a760eb.zip
replaced xalloc with malloc functions, udp input support (untested), fixed http
Diffstat (limited to 'main.c')
-rw-r--r--main.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/main.c b/main.c
index 478d8d8..7191a9f 100644
--- a/main.c
+++ b/main.c
@@ -326,7 +326,7 @@ processArguments(rfbScreenInfoPtr rfbScreen,int argc, char *argv[])
rfbScreen->rfbMaxClientWait = atoi(argv[++i]);
} else if (strcmp(argv[i], "-rfbauth") == 0) { /* -rfbauth passwd-file */
if (i + 1 >= argc) usage();
- rfbScreen->rfbAuthPasswdFile = argv[++i];
+ rfbScreen->rfbAuthPasswdData = argv[++i];
} else if (strcmp(argv[i], "-desktop") == 0) { /* -desktop desktop-name */
if (i + 1 >= argc) usage();
rfbScreen->desktopName = argv[++i];
@@ -400,6 +400,15 @@ rfbCursorPtr defaultGetCursorPtr(rfbClientPtr cl)
return(cl->screen->cursor);
}
+Bool defaultGetPassword(rfbClientPtr cl,char* passwd,int len)
+{
+ char *pwd=vncDecryptPasswdFromFile(cl->screen->rfbAuthPasswdData);
+ if(!pwd)
+ return(FALSE);
+ strncpy(passwd,pwd,MAXPWLEN);
+ return(TRUE);
+}
+
void doNothingWithClient(rfbClientPtr cl)
{
}
@@ -511,6 +520,7 @@ rfbScreenInfoPtr rfbGetScreen(int argc,char** argv,
rfbScreen->setXCutText = defaultSetXCutText;
rfbScreen->getCursorPtr = defaultGetCursorPtr;
rfbScreen->setTranslateFunction = rfbSetTranslateFunction;
+ rfbScreen->getPassword = defaultGetPassword;
rfbScreen->newClientHook = doNothingWithClient;
rfbScreen->displayHook = 0;