summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
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;