diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | libvncserver/cargs.c | 12 | ||||
-rw-r--r-- | libvncserver/main.c | 7 | ||||
-rw-r--r-- | libvncserver/rfbserver.c | 16 | ||||
-rw-r--r-- | rfb/rfb.h | 3 | ||||
-rw-r--r-- | rfb/rfbproto.h | 2 |
6 files changed, 40 insertions, 6 deletions
@@ -1,4 +1,10 @@ 2006-05-15 Steven Carr <scarr@jsa-usa.com> + * Default to RFB 3.8 + * Add command line options: + -rfbversion X.Y Sets the version thatthe server reports + -permitfiletransfer Permits File Transfer (Default is Deny) + +2006-05-15 Steven Carr <scarr@jsa-usa.com> * The great UltraVNC Compatibility Commit! libvncserver now supports the following messages: SetSingleWindow - Select a single window to be the source of the diff --git a/libvncserver/cargs.c b/libvncserver/cargs.c index 26f03d6..8338861 100644 --- a/libvncserver/cargs.c +++ b/libvncserver/cargs.c @@ -25,6 +25,8 @@ rfbUsage(void) fprintf(stderr, "-rfbwait time max time in ms to wait for RFB client\n"); fprintf(stderr, "-rfbauth passwd-file use authentication on RFB protocol\n" " (use 'storepasswd' to create a password file)\n"); + fprintf(stderr, "-rfbversion 3.x Set the version of the RFB we choose to advertise\n"); + fprintf(stderr, "-permitfiletransfer permit file transfer support\n"); fprintf(stderr, "-passwd plain-password use authentication \n" " (use plain-password as password, USE AT YOUR RISK)\n"); fprintf(stderr, "-deferupdate time time in ms to defer updates " @@ -90,6 +92,16 @@ rfbProcessArguments(rfbScreenInfoPtr rfbScreen,int* argc, char *argv[]) return FALSE; } rfbScreen->authPasswdData = argv[++i]; + + fprintf(stderr, "-permitfiletransfer permit file transfer support\n"); + } else if (strcmp(argv[i], "-permitfiletransfer") == 0) { /* -permitfiletransfer */ + rfbScreen->permitFileTransfer = TRUE; + } else if (strcmp(argv[i], "-rfbversion") == 0) { /* -rfbversion 3.6 */ + if (i + 1 >= *argc) { + rfbUsage(); + return FALSE; + } + sscanf(argv[++i],"%d.%d", &rfbScreen->protocolMajorVersion, &rfbScreen->protocolMinorVersion); } else if (strcmp(argv[i], "-passwd") == 0) { /* -passwd password */ char **passwds = malloc(sizeof(char**)*2); if (i + 1 >= *argc) { diff --git a/libvncserver/main.c b/libvncserver/main.c index cded456..ee5af4a 100644 --- a/libvncserver/main.c +++ b/libvncserver/main.c @@ -836,9 +836,10 @@ rfbScreenInfoPtr rfbGetScreen(int* argc,char** argv, screen->handleEventsEagerly = FALSE; - /* Emulate UltraVNC Server by default */ - screen->protocolMajorVersion = 3; - screen->protocolMinorVersion = 6; + screen->protocolMajorVersion = rfbProtocolMajorVersion; + screen->protocolMinorVersion = rfbProtocolMinorVersion; + + screen->permitFileTransfer = FALSE; if(!rfbProcessArguments(screen,argc,argv)) { free(screen); diff --git a/libvncserver/rfbserver.c b/libvncserver/rfbserver.c index ab4e04f..d3d4409 100644 --- a/libvncserver/rfbserver.c +++ b/libvncserver/rfbserver.c @@ -1589,8 +1589,20 @@ rfbBool rfbProcessFileTransfer(rfbClientPtr cl, uint8_t contentType, uint8_t con return rfbSendFileTransferMessage(cl, rfbFileTransferAccess, 0, -1 , 0, ""); /* Deny */ } } - rfbLog("rfbProcessFileTransfer() File Transfer Permission DENIED by default!\n"); - return rfbSendFileTransferMessage(cl, rfbFileTransferAccess, 0, -1 , 0, ""); /* DEFAULT: DENY (for security) */ + else + { + if (cl->screen->permitFileTransfer) + { + rfbLog("rfbProcessFileTransfer() File Transfer Permission Granted!\n"); + return rfbSendFileTransferMessage(cl, rfbFileTransferAccess, 0, 1 , 0, ""); /* Permit */ + } + else + { + rfbLog("rfbProcessFileTransfer() File Transfer Permission DENIED by default!\n"); + return rfbSendFileTransferMessage(cl, rfbFileTransferAccess, 0, -1 , 0, ""); /* DEFAULT: DENY (for security) */ + } + + } } break; @@ -348,6 +348,9 @@ typedef struct _rfbScreenInfo /* What does the server tell the new clients which version it supports */ int protocolMajorVersion; int protocolMinorVersion; + + /* command line authorization of file transfers */ + rfbBool permitFileTransfer; } rfbScreenInfo, *rfbScreenInfoPtr; diff --git a/rfb/rfbproto.h b/rfb/rfbproto.h index 672d0d7..4d5812a 100644 --- a/rfb/rfbproto.h +++ b/rfb/rfbproto.h @@ -218,7 +218,7 @@ typedef struct { #define rfbProtocolVersionFormat "RFB %03d.%03d\n" #define rfbProtocolMajorVersion 3 -#define rfbProtocolMinorVersion 6 +#define rfbProtocolMinorVersion 8 /* UltraVNC Viewer examines rfbProtocolMinorVersion number (4, and 6) * to identify if the server supports File Transfer */ |