mirror of
git://git.proxmox.com/git/vncterm.git
synced 2025-01-10 09:17:38 +03:00
70 lines
2.1 KiB
Diff
70 lines
2.1 KiB
Diff
Index: vnc/libvncserver/auth.c
|
|
===================================================================
|
|
@@ -300,8 +300,9 @@
|
|
int32_t securityType = rfbSecTypeInvalid;
|
|
|
|
if (!cl->screen->authPasswdData || cl->reverseConnection) {
|
|
- /* chk if this condition is valid or not. */
|
|
- securityType = rfbSecTypeNone;
|
|
+ /* chk if this condition is valid or not. */
|
|
+ /* we disable anonymous auth */
|
|
+ // securityType = rfbSecTypeNone;
|
|
} else if (cl->screen->authPasswdData) {
|
|
securityType = rfbSecTypeVncAuth;
|
|
}
|
|
Index: vnc/newterm/Makefile.am
|
|
Index: vnc/libvncserver/sockets.c
|
|
===================================================================
|
|
--- vnc.orig/libvncserver/sockets.c 2011-01-20 16:42:41.000000000 +0100
|
|
+++ vnc/libvncserver/sockets.c 2011-01-21 10:20:03.000000000 +0100
|
|
@@ -613,7 +613,11 @@ rfbReadExactTimeout(rfbClientPtr cl, char* buf, int len, int timeout)
|
|
n = read(sock, buf, len);
|
|
}
|
|
#else
|
|
- n = read(sock, buf, len);
|
|
+ if (cl->sock_read_fn) {
|
|
+ n = cl->sock_read_fn(cl, buf, len);
|
|
+ } else {
|
|
+ n = read(sock, buf, len);
|
|
+ }
|
|
#endif
|
|
|
|
if (n > 0) {
|
|
@@ -801,7 +805,11 @@ rfbWriteExact(rfbClientPtr cl,
|
|
n = rfbssl_write(cl, buf, len);
|
|
else
|
|
#endif
|
|
+ if (cl->sock_write_fn) {
|
|
+ n = cl->sock_write_fn(cl, buf, len);
|
|
+ } else {
|
|
n = write(sock, buf, len);
|
|
+ }
|
|
|
|
if (n > 0) {
|
|
|
|
Index: vnc/rfb/rfb.h
|
|
===================================================================
|
|
--- vnc.orig/rfb/rfb.h 2011-01-20 16:36:06.000000000 +0100
|
|
+++ vnc/rfb/rfb.h 2011-01-21 06:44:22.000000000 +0100
|
|
@@ -397,6 +397,9 @@
|
|
struct _rfbStatList *Next;
|
|
} rfbStatList;
|
|
|
|
+typedef ssize_t (*sock_read_fn_t)(struct _rfbClientRec *cl, void *buf, size_t count);
|
|
+typedef ssize_t (*sock_write_fn_t)(struct _rfbClientRec *cl, const void *buf, size_t count);
|
|
+
|
|
typedef struct _rfbClientRec {
|
|
|
|
/* back pointer to the screen */
|
|
@@ -417,6 +420,10 @@
|
|
void* clientData;
|
|
ClientGoneHookPtr clientGoneHook;
|
|
|
|
+ /* use to hook up TLS read/write */
|
|
+ sock_read_fn_t sock_read_fn;
|
|
+ sock_read_fn_t sock_write_fn;
|
|
+
|
|
SOCKET sock;
|
|
char *host;
|
|
|