From 057fdbb3eb8671886f0f6777e8af3098eaed55ae Mon Sep 17 00:00:00 2001 From: runge Date: Fri, 16 Feb 2007 19:58:34 +0000 Subject: x11vnc: add Files mode to user controlled input. more ultra/tight filexfer tweaks. rfbversion remote control. noncache/nc unixpw user opt. --- x11vnc/remote.c | 42 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) (limited to 'x11vnc/remote.c') diff --git a/x11vnc/remote.c b/x11vnc/remote.c index 19201cb..85d92d1 100644 --- a/x11vnc/remote.c +++ b/x11vnc/remote.c @@ -1272,7 +1272,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { } #ifdef LIBVNCSERVER_WITH_TIGHTVNC_FILETRANSFER if (! tightfilexfer) { - rfbLog("remote_cmd: enabling -tightfilexfer for new clients.\n"); + rfbLog("remote_cmd: enabling -tightfilexfer for *NEW* clients.\n"); tightfilexfer = 1; rfbRegisterTightVNCFileTransferExtension(); } @@ -1287,7 +1287,7 @@ char *process_remote_cmd(char *cmd, int stringonly) { } #ifdef LIBVNCSERVER_WITH_TIGHTVNC_FILETRANSFER if (tightfilexfer) { - rfbLog("remote_cmd: disabling -tightfilexfer for new clients.\n"); + rfbLog("remote_cmd: disabling -tightfilexfer for *NEW* clients.\n"); tightfilexfer = 0; rfbUnregisterTightVNCFileTransferExtension(); } @@ -1295,6 +1295,44 @@ char *process_remote_cmd(char *cmd, int stringonly) { rfbLog("remote_cmd: -tightfilexfer not supported in this binary.\n"); #endif + } else if (!strcmp(p, "ultrafilexfer")) { + if (query) { + snprintf(buf, bufn, "ans=%s:%d", p, screen->permitFileTransfer == TRUE); + goto qry; + } + if (! screen->permitFileTransfer) { + rfbLog("remote_cmd: enabling -ultrafilexfer for clients.\n"); + screen->permitFileTransfer = TRUE; + } + + } else if (!strcmp(p, "noultrafilexfer")) { + if (query) { + snprintf(buf, bufn, "ans=%s:%d", p, screen->permitFileTransfer == FALSE); + goto qry; + } + if (screen->permitFileTransfer) { + rfbLog("remote_cmd: disabling -ultrafilexfer for clients.\n"); + screen->permitFileTransfer = FALSE; + } + + } else if (strstr(p, "rfbversion") == p) { + int maj, min; + COLON_CHECK("rfbversion:") + if (query) { + snprintf(buf, bufn, "ans=%s:%d.%d", p, screen->protocolMajorVersion, screen->protocolMinorVersion); + goto qry; + } + p += strlen("rfbversion:"); + + if (sscanf(p, "%d.%d", &maj, &min) == 2) { + screen->protocolMajorVersion = maj; + screen->protocolMinorVersion = min; + rfbLog("remote_cmd: set rfbversion to: %d.%d\n", maj, min); + } else { + rfbLog("remote_cmd: invalid rfbversion: %s\n", p); + } + + } else if (!strcmp(p, "deny") || !strcmp(p, "lock")) { if (query) { snprintf(buf, bufn, "ans=%s:%d", p, deny_all); -- cgit v1.2.3