Commit f7d48515 authored by runge's avatar runge

Add logging output to know when inside tightvnc-filetransfer functions.

parent 3110c0e3
...@@ -71,6 +71,8 @@ InitFileTransfer() ...@@ -71,6 +71,8 @@ InitFileTransfer()
if(fileTransferInitted) if(fileTransferInitted)
return; return;
rfbLog("tightvnc-filetransfer/InitFileTransfer\n");
memset(ftproot, 0, sizeof(ftproot)); memset(ftproot, 0, sizeof(ftproot));
userHome = GetHomeDir(uid); userHome = GetHomeDir(uid);
...@@ -98,6 +100,8 @@ SetFtpRoot(char* path) ...@@ -98,6 +100,8 @@ SetFtpRoot(char* path)
struct stat stat_buf; struct stat stat_buf;
DIR* dir = NULL; DIR* dir = NULL;
rfbLog("tightvnc-filetransfer/SetFtpRoot\n");
if((path == NULL) || (strlen(path) == 0) || (strlen(path) > (PATH_MAX - 1))) { if((path == NULL) || (strlen(path) == 0) || (strlen(path) > (PATH_MAX - 1))) {
rfbLog("File [%s]: Method [%s]: parameter passed is improper, ftproot" rfbLog("File [%s]: Method [%s]: parameter passed is improper, ftproot"
" not changed\n", __FILE__, __FUNCTION__); " not changed\n", __FILE__, __FUNCTION__);
......
...@@ -59,6 +59,7 @@ static void ...@@ -59,6 +59,7 @@ static void
rfbVncAuthSendChallenge(rfbClientPtr cl) rfbVncAuthSendChallenge(rfbClientPtr cl)
{ {
rfbLog("tightvnc-filetransfer/rfbVncAuthSendChallenge\n");
/* 4 byte header is alreay sent. Which is rfbSecTypeVncAuth (same as rfbVncAuth). Just send the challenge. */ /* 4 byte header is alreay sent. Which is rfbSecTypeVncAuth (same as rfbVncAuth). Just send the challenge. */
rfbRandomBytes(cl->authChallenge); rfbRandomBytes(cl->authChallenge);
if (rfbWriteExact(cl, (char *)cl->authChallenge, CHALLENGESIZE) < 0) { if (rfbWriteExact(cl, (char *)cl->authChallenge, CHALLENGESIZE) < 0) {
...@@ -84,6 +85,8 @@ rfbProcessClientAuthType(rfbClientPtr cl) ...@@ -84,6 +85,8 @@ rfbProcessClientAuthType(rfbClientPtr cl)
int n, i; int n, i;
rfbTightClientPtr rtcp = rfbGetTightClientData(cl); rfbTightClientPtr rtcp = rfbGetTightClientData(cl);
rfbLog("tightvnc-filetransfer/rfbProcessClientAuthType\n");
if(rtcp == NULL) if(rtcp == NULL)
return; return;
...@@ -155,6 +158,8 @@ rfbSendAuthCaps(rfbClientPtr cl) ...@@ -155,6 +158,8 @@ rfbSendAuthCaps(rfbClientPtr cl)
int count = 0; int count = 0;
rfbTightClientPtr rtcp = rfbGetTightClientData(cl); rfbTightClientPtr rtcp = rfbGetTightClientData(cl);
rfbLog("tightvnc-filetransfer/rfbSendAuthCaps\n");
if(rtcp == NULL) if(rtcp == NULL)
return; return;
...@@ -199,6 +204,8 @@ rfbSendTunnelingCaps(rfbClientPtr cl) ...@@ -199,6 +204,8 @@ rfbSendTunnelingCaps(rfbClientPtr cl)
rfbTunnelingCapsMsg caps; rfbTunnelingCapsMsg caps;
uint32_t nTypes = 0; /* we don't support tunneling yet */ uint32_t nTypes = 0; /* we don't support tunneling yet */
rfbLog("tightvnc-filetransfer/rfbSendTunnelingCaps\n");
caps.nTunnelTypes = Swap32IfLE(nTypes); caps.nTunnelTypes = Swap32IfLE(nTypes);
if (rfbWriteExact(cl, (char *)&caps, sz_rfbTunnelingCapsMsg) < 0) { if (rfbWriteExact(cl, (char *)&caps, sz_rfbTunnelingCapsMsg) < 0) {
rfbLogPerror("rfbSendTunnelingCaps: write"); rfbLogPerror("rfbSendTunnelingCaps: write");
...@@ -245,6 +252,8 @@ rfbSendInteractionCaps(rfbClientPtr cl) ...@@ -245,6 +252,8 @@ rfbSendInteractionCaps(rfbClientPtr cl)
intr_caps.nEncodingTypes = Swap16IfLE(N_ENC_CAPS); intr_caps.nEncodingTypes = Swap16IfLE(N_ENC_CAPS);
intr_caps.pad = 0; intr_caps.pad = 0;
rfbLog("tightvnc-filetransfer/rfbSendInteractionCaps\n");
/* Supported server->client message types. */ /* Supported server->client message types. */
/* For file transfer support: */ /* For file transfer support: */
i = 0; i = 0;
...@@ -337,7 +346,7 @@ handleMessage(rfbClientPtr cl, ...@@ -337,7 +346,7 @@ handleMessage(rfbClientPtr cl,
{ {
rfbTightClientPtr data; rfbTightClientPtr data;
rfbLog("%s message received\n", messageName); rfbLog("tightvnc-filetransfer: %s message received\n", messageName);
if((IsFileTransferEnabled() == FALSE) || ( cl->viewOnly == TRUE)) { if((IsFileTransferEnabled() == FALSE) || ( cl->viewOnly == TRUE)) {
rfbCloseClient(cl); rfbCloseClient(cl);
...@@ -425,6 +434,8 @@ rfbTightUsage(void) { ...@@ -425,6 +434,8 @@ rfbTightUsage(void) {
int int
rfbTightProcessArg(int argc, char *argv[]) { rfbTightProcessArg(int argc, char *argv[]) {
rfbLog("tightvnc-filetransfer/rfbTightProcessArg\n");
InitFileTransfer(); InitFileTransfer();
if(argc<1) if(argc<1)
...@@ -453,6 +464,8 @@ rfbTightProcessArg(int argc, char *argv[]) { ...@@ -453,6 +464,8 @@ rfbTightProcessArg(int argc, char *argv[]) {
void void
rfbHandleSecTypeTight(rfbClientPtr cl) { rfbHandleSecTypeTight(rfbClientPtr cl) {
rfbLog("tightvnc-filetransfer/rfbHandleSecTypeTight\n");
rfbTightClientPtr rtcp = (rfbTightClientPtr) malloc(sizeof(rfbTightClientRec)); rfbTightClientPtr rtcp = (rfbTightClientPtr) malloc(sizeof(rfbTightClientRec));
if(rtcp == NULL) { if(rtcp == NULL) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment