diff options
author | steven_carr <steven_carr> | 2006-05-15 18:17:31 +0000 |
---|---|---|
committer | steven_carr <steven_carr> | 2006-05-15 18:17:31 +0000 |
commit | 1c3af68549c544de065ceedec518449ee8cff49d (patch) | |
tree | 0c5638ca7dc34fa2101d7b7e3280b387ee07f1a6 /libvncserver | |
parent | ccdbe8f3256c3c776a1cc1a0517a38437b9e2c65 (diff) | |
download | libtdevnc-1c3af68549c544de065ceedec518449ee8cff49d.tar.gz libtdevnc-1c3af68549c544de065ceedec518449ee8cff49d.zip |
Default to RFB 3.8, add command line option to specify the RFB version.
Diffstat (limited to 'libvncserver')
-rw-r--r-- | libvncserver/cargs.c | 12 | ||||
-rw-r--r-- | libvncserver/main.c | 7 | ||||
-rw-r--r-- | libvncserver/rfbserver.c | 16 |
3 files changed, 30 insertions, 5 deletions
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; |