summaryrefslogtreecommitdiffstats
path: root/libvncserver
diff options
context:
space:
mode:
authorrunge <runge>2004-05-27 17:27:34 +0000
committerrunge <runge>2004-05-27 17:27:34 +0000
commite3c8cddef9c6be8d9e8fdb2dd65d286992b78fc5 (patch)
treea9b9ecd30ea1880358ff6b40d6ab529fcfe46ea8 /libvncserver
parentfcf44cf5ae60986712f5adc0a77d7c0abee2e36b (diff)
downloadlibtdevnc-e3c8cddef9c6be8d9e8fdb2dd65d286992b78fc5.tar.gz
libtdevnc-e3c8cddef9c6be8d9e8fdb2dd65d286992b78fc5.zip
x11vnc: view-only plain passwd: -viewpasswd and 2nd line of -passwdfile
Diffstat (limited to 'libvncserver')
-rw-r--r--libvncserver/main.c6
-rw-r--r--libvncserver/rfbserver.c22
2 files changed, 15 insertions, 13 deletions
diff --git a/libvncserver/main.c b/libvncserver/main.c
index 488f09d..3182145 100644
--- a/libvncserver/main.c
+++ b/libvncserver/main.c
@@ -473,9 +473,11 @@ rfbBool rfbCheckPasswordByList(rfbClientPtr cl,const char* response,int len)
int i=0;
for(passwds=(char**)cl->screen->rfbAuthPasswdData;*passwds;passwds++,i++) {
- vncEncryptBytes(cl->authChallenge, *passwds);
+ uint8_t auth_tmp[CHALLENGESIZE];
+ memcpy((char *)auth_tmp, (char *)cl->authChallenge, CHALLENGESIZE);
+ vncEncryptBytes(auth_tmp, *passwds);
- if (memcmp(cl->authChallenge, response, len) == 0) {
+ if (memcmp(auth_tmp, response, len) == 0) {
if(i>=cl->screen->rfbAuthPasswdFirstViewOnly)
cl->viewOnly=TRUE;
return(TRUE);
diff --git a/libvncserver/rfbserver.c b/libvncserver/rfbserver.c
index e22283e..4fe2605 100644
--- a/libvncserver/rfbserver.c
+++ b/libvncserver/rfbserver.c
@@ -1017,22 +1017,22 @@ rfbProcessClientNormalMessage(cl)
return;
}
- if(!cl->viewOnly) {
- msg.cct.length = Swap32IfLE(msg.cct.length);
+ msg.cct.length = Swap32IfLE(msg.cct.length);
- str = (char *)malloc(msg.cct.length);
+ str = (char *)malloc(msg.cct.length);
- if ((n = ReadExact(cl, str, msg.cct.length)) <= 0) {
- if (n != 0)
- rfbLogPerror("rfbProcessClientNormalMessage: read");
- free(str);
- rfbCloseClient(cl);
- return;
- }
+ if ((n = ReadExact(cl, str, msg.cct.length)) <= 0) {
+ if (n != 0)
+ rfbLogPerror("rfbProcessClientNormalMessage: read");
+ free(str);
+ rfbCloseClient(cl);
+ return;
+ }
+ if(!cl->viewOnly) {
cl->screen->setXCutText(str, msg.cct.length, cl);
- free(str);
}
+ free(str);
return;